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

Quality checks: add incomplete-feature and workflow-recovery audits, widen UX and UI-bug coverage (#9952)

[._.]/0422dd34ea7b
diff --git a/client/src/components/CmdKSearch.jsx b/client/src/components/CmdKSearch.jsx
index b5454a995d..1b853057b7 100644
--- a/client/src/components/CmdKSearch.jsx
+++ b/client/src/components/CmdKSearch.jsx
@@ -206,7 +206,7 @@ export default function CmdKSearch() {
}
let cancelled = false;
const timer = setTimeout(() => {
- listCatalogIngredients({ q: query, limit: 5 }, { silent: true })
+ listCatalogIngredients({ q: query, limit: 5, silent: true })
.then((data) => { if (!cancelled) setCatalogResults(data?.items ?? []); })
.catch(() => { if (!cancelled) setCatalogResults([]); });
}, 300);
diff --git a/client/src/components/brain/tabs/NotesTab.jsx b/client/src/components/brain/tabs/NotesTab.jsx
index f8b1977c36..4c83c586aa 100644
--- a/client/src/components/brain/tabs/NotesTab.jsx
+++ b/client/src/components/brain/tabs/NotesTab.jsx
@@ -670,7 +670,7 @@ export default function NotesTab() {
onClickItem={link => {
const match = notes.find(n => n.name.toLowerCase() === link.toLowerCase());
if (match) handleSelectNote(match.path);
- else toast.warn(`Note "${link}" not found in vault`);
+ else toast.warning(`Note "${link}" not found in vault`);
}} />
<LinkSection icon={<ArrowLeft size={10} />} label="Backlinks" items={note.backlinks}
getKey={bl => bl.path} getLabel={bl => bl.name}
diff --git a/client/src/components/settings/OrchestrationTab.jsx b/client/src/components/settings/OrchestrationTab.jsx
index 16a8fb95f3..6bd96983ad 100644
--- a/client/src/components/settings/OrchestrationTab.jsx
+++ b/client/src/components/settings/OrchestrationTab.jsx
@@ -2,6 +2,8 @@ import { useState, useEffect, useCallback } from 'react';
import { Plus, Edit2, Trash2, Cpu, Check, X, Shield, Sparkles } from 'lucide-react';
import toast from '../ui/Toast';
import FormField from '../ui/FormField';
+import ConfirmButtonPair from '../ui/ConfirmButtonPair';
+import { useConfirmDelete } from '../../hooks/useConfirmDelete';
import ProviderModelSelector from '../ProviderModelSelector';
import * as api from '../../services/api';
import { effortAwareModelOptions, effortSurvivingModel } from '../../utils/providers';
@@ -33,6 +35,7 @@ export default function OrchestrationTab() {
const [isNew, setIsNew] = useState(false);
const [saving, setSaving] = useState(false);
const [deletingId, setDeletingId] = useState(null);
+ const deleteConfirm = useConfirmDelete();
const loadData = useCallback(async () => {
setLoading(true);
@@ -130,7 +133,6 @@ export default function OrchestrationTab() {
};
const handleDelete = async (id, name) => {
- if (!confirm(`Are you sure you want to delete profile "${name}"?`)) return;
setDeletingId(id);
try {
await api.deleteOrchestrationProfile(id);
@@ -383,9 +385,19 @@ export default function OrchestrationTab() {
>
<Edit2 size={16} />
</button>
- {!p.isBuiltin && (
+ {!p.isBuiltin && (deleteConfirm.isConfirming(p.id) || isDeleting ? (
+ <ConfirmButtonPair
+ prompt="Delete?"
+ onConfirm={() => deleteConfirm.confirmDelete(() => handleDelete(p.id, p.name))}
+ onCancel={deleteConfirm.cancelDelete}
+ busy={isDeleting}
+ busyText="Deleting"
+ ariaLabel={`Confirm deleting profile ${p.name}`}
+ largeTouchTargets
+ />
+ ) : (
<button
- onClick={() => handleDelete(p.id, p.name)}
+ onClick={() => deleteConfirm.requestDelete(p.id)}
disabled={isDeleting}
className="p-2 hover:bg-red-500/20 text-gray-400 hover:text-red-400 rounded-lg transition-colors disabled:opacity-50 min-h-[44px] min-w-[44px] inline-flex items-center justify-center"
title="Delete profile"
@@ -393,7 +405,7 @@ export default function OrchestrationTab() {
>
<Trash2 size={16} />
</button>
- )}
+ ))}
</div>
</div>
diff --git a/client/src/components/settings/OrchestrationTab.test.jsx b/client/src/components/settings/OrchestrationTab.test.jsx
index 3b381890b3..5fefbadfaf 100644
--- a/client/src/components/settings/OrchestrationTab.test.jsx
+++ b/client/src/components/settings/OrchestrationTab.test.jsx
@@ -83,17 +83,16 @@ describe('OrchestrationTab', () => {
});
});
- it('allows deleting non-builtin profiles', async () => {
- window.confirm = vi.fn(() => true);
+ it('confirms inline before deleting a non-builtin profile', async () => {
api.deleteOrchestrationProfile.mockResolvedValue({ success: true });
render(<OrchestrationTab />);
await waitFor(() => expect(screen.getByText('Custom Team')).toBeTruthy());
- const deleteBtn = screen.getByLabelText('Delete profile Custom Team');
- fireEvent.click(deleteBtn);
+ fireEvent.click(screen.getByLabelText('Delete profile Custom Team'));
+ expect(api.deleteOrchestrationProfile).not.toHaveBeenCalled();
- expect(window.confirm).toHaveBeenCalled();
+ fireEvent.click(screen.getByRole('button', { name: 'Delete' }));
await waitFor(() => {
expect(api.deleteOrchestrationProfile).toHaveBeenCalledWith('custom-team');
});
diff --git a/client/src/moduleContractConventions.test.js b/client/src/moduleContractConventions.test.js
new file mode 100644
index 0000000000..75ade870d4
--- /dev/null
+++ b/client/src/moduleContractConventions.test.js
@@ -0,0 +1,171 @@
+/**
+ * Cross-module contract guards for an untyped client.
+ *
+ * PortOS's client is plain JavaScript, so nothing checks that a call site and
+ * the module it imports agree. `toast.info(...)` shipped at ~30 call sites
+ * while the shared Toast API had no `info` member: every one threw
+ * `toast.info is not a function` at runtime, and the component tests stayed
+ * green because 54 of them mocked Toast WITH an `info` the real module lacked.
+ * No scheduled audit owned that class — `typing` only runs on TypeScript repos,
+ * `ui-bugs` needs a live reproduction, and `api-contract` stops at HTTP.
+ *
+ * Three rules, each cheap and deterministic:
+ *
+ * 1. Every `<local>.<member>` read on an imported object-API module names a
+ * member the real export has. `CONTRACT_MODULES` lists the modules whose
+ * default export is a member-bag; add a row when another shared module
+ * takes that shape.
+ * 2. A test's `vi.mock` factory for one of those modules defines only members
+ * the real export has, so a mock cannot paper over a missing member again.
+ * 3. No browser `alert`/`confirm`/`prompt` (client/src/AGENTS.md: inline
+ * confirmations or toasts instead). Blocking dialogs freeze the tab and are
+ * unusable from a PWA or a remote session.
+ *
+ * Scoped to git-tracked sources under `client/src`; comments are masked first.
+ */
+
+import { describe, it, expect } from 'vitest';
+import { readFileSync } from 'fs';
+import { join, dirname } from 'path';
+import { fileURLToPath } from 'url';
+import { execSync } from 'child_process';
+import { trackedSourceFiles } from './test/trackedFiles.js';
+import { lineOf, maskComments } from './test/classNameScan.js';
+
+const CLIENT_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
+
+/** Shared modules whose default export is an object API callers dot into. */
+const CONTRACT_MODULES = [
+ {
+ file: 'src/components/ui/Toast.jsx',
+ // Import specifiers end in one of these (with or without the extension).
+ specifier: /(?:^|\/)ui\/Toast(?:\.jsx)?$/,
+ namedAliases: ['toast'],
+ load: async () => {
+ const mod = await import('./components/ui/Toast.jsx');
+ return { api: mod.default, exportNames: Object.keys(mod) };
+ },
+ },
+];
+
+const IMPORT_RE = /import\s+([^'"]+?)\s+from\s+['"]([^'"]+)['"]/g;
+
+/** Local bindings that refer to the module's object API in one file. */
+export function contractBindings(source, contract) {
+ const locals = new Set();
+ for (const match of source.matchAll(IMPORT_RE)) {
+ if (!contract.specifier.test(match[2])) continue;
+ const clause = match[1].trim();
+ const defaultName = clause.match(/^([A-Za-z_$][\w$]*)/);
+ if (defaultName) locals.add(defaultName[1]);
+ const named = clause.match(/\{([^}]*)\}/);
+ if (!named) continue;
+ for (const part of named[1].split(',')) {
+ const [imported, alias] = part.trim().split(/\s+as\s+/);
+ if (contract.namedAliases.includes(imported)) locals.add(alias || imported);
+ }
+ }
+ return locals;
+}
+
+/** `<local>.<member>` reads whose member the real API lacks. */
+export function missingMembers(rawSource, file, contract, members) {
+ const source = maskComments(rawSource);
+ const violations = [];
+ for (const local of contractBindings(source, contract)) {
+ const access = new RegExp(`(?<![\\w$.])${local.replace(/\$/g, '\\$')}\\.([A-Za-z_$][\\w$]*)`, 'g');
+ for (const match of source.matchAll(access)) {
+ if (!members.has(match[1])) violations.push(`${file}:${lineOf(source, match.index)} — ${local}.${match[1]}`);
+ }
+ }
+ return violations;
+}
+
+/** The balanced `( … )` argument text starting at `open`, or '' when unbalanced. */
+function balancedArgs(source, open) {
+ let depth = 0;
+ for (let i = open; i < source.length; i += 1) {
+ if (source[i] === '(') depth += 1;
+ else if (source[i] === ')') {
+ depth -= 1;
+ if (depth === 0) return source.slice(open, i + 1);
+ }
+ }
+ return '';
+}
+
+const MOCK_KEY_RE = /(?<![\w$.'"])([A-Za-z_$][\w$]*)\s*:\s*(?:vi\.fn|\(|async\b|function\b)/g;
+
+/** Keys a `vi.mock(<contract module>, factory)` defines that the real module lacks. */
+export function mockDrift(rawSource, file, contract, allowed) {
+ const source = maskComments(rawSource);
+ const violations = [];
+ for (const call of source.matchAll(/vi\.mock\(\s*['"]([^'"]+)['"]/g)) {
+ if (!contract.specifier.test(call[1])) continue;
+ const args = balancedArgs(source, call.index + 'vi.mock'.length);
+ for (const key of args.matchAll(MOCK_KEY_RE)) {
+ if (!allowed.has(key[1])) violations.push(`${file}:${lineOf(source, call.index)} — mocks ${key[1]}`);
+ }
+ }
+ return violations;
+}
+
+const BLOCKING_DIALOG_RE = /(?<![\w$.])(?:window\.)?(alert|confirm)\s*\(/g;
+
+/** Calls to the browser's blocking dialogs (bare or via `window.`). */
+export function blockingDialogs(rawSource, file) {
+ const source = maskComments(rawSource)
+ // A declaration or method shorthand named confirm/prompt is not a call to the global.
+ .replace(/\bfunction\s+(?:alert|confirm)\s*\(/g, 'function _(');
+ return [...source.matchAll(BLOCKING_DIALOG_RE)]
+ // `confirm(id) {` / `confirm(id) =>` is a method or callback being defined, not a call.
+ .filter((match) => match[0].startsWith('window.')
+ || !/^[^)]*\)\s*(?:\{|=>)/.test(source.slice(match.index + match[0].length).split('\n')[0]))
+ .map((match) => `${file}:${lineOf(source, match.index)} — ${match[0].replace(/\s*\($/, '')}()`);
+}
+
+const read = (file) => readFileSync(join(CLIENT_ROOT, file), 'utf8');
+
+const trackedTestFiles = () => execSync('git ls-files src', { cwd: CLIENT_ROOT, encoding: 'utf8' })
+ .trim().split('\n').filter((f) => /\.test\.jsx?$/.test(f));
+
+describe('module contract conventions', () => {
+ const files = trackedSourceFiles(CLIENT_ROOT);
+
+ it('scans a populated client tree', () => {
+ expect(files.length).toBeGreaterThan(100);
+ });
+
+ it('detects a missing member, a drifted mock and a blocking dialog', () => {
+ const [contract] = CONTRACT_MODULES;
+ const members = new Set(['success', 'warning']);
+ expect(missingMembers("import toast from '../ui/Toast';\ntoast.warn('x'); toast.success('y');", 'probe.jsx', contract, members))
+ .toEqual(['probe.jsx:2 — toast.warn']);
+ expect(missingMembers("import { toast as t } from '../ui/Toast.jsx';\nt.info('x');", 'probe.jsx', contract, members))
+ .toEqual(['probe.jsx:2 — t.info']);
+ expect(missingMembers("import toast from './toastish';\ntoast.warn('x');", 'probe.jsx', contract, members)).toEqual([]);
+ expect(mockDrift("vi.mock('../ui/Toast', () => ({ default: { success: vi.fn(), info: vi.fn() } }));", 'probe.test.jsx', contract, new Set(['default', 'success'])))
+ .toEqual(['probe.test.jsx:1 — mocks info']);
+ expect(blockingDialogs("if (!confirm('Delete?')) return;\nwindow.alert('x');", 'probe.jsx'))
+ .toEqual(['probe.jsx:1 — confirm()', 'probe.jsx:2 — window.alert()']);
+ expect(blockingDialogs("const confirm = useConfirmDelete();\ndeleteConfirm.confirm();\n// confirm('x')", 'probe.jsx')).toEqual([]);
+ });
+
+ for (const contract of CONTRACT_MODULES) {
+ it(`calls only members ${contract.file} exports`, async () => {
+ const { api, exportNames } = await contract.load();
+ const members = new Set(Object.keys(api));
+ const violations = files.flatMap((file) => missingMembers(read(file), file, contract, members));
+ expect(violations, 'call a member the module defines, or add the member to the module').toEqual([]);
+
+ const allowed = new Set([...members, ...exportNames, '__esModule']);
+ const drift = trackedTestFiles().flatMap((file) => mockDrift(read(file), file, contract, allowed));
+ expect(drift, 'a mock must not define a member the real module lacks').toEqual([]);
+ });
+ }
+
+ it('never calls the browser alert/confirm/prompt dialogs', () => {
+ const violations = files.flatMap((file) => blockingDialogs(read(file), file));
+ expect(violations, 'use an inline confirmation (useConfirmDelete + ConfirmButtonPair) or a toast').toEqual([]);
+ });
+});
diff --git a/client/src/pages/Apps.test.jsx b/client/src/pages/Apps.test.jsx
index 7f812db29b..3b28bbec21 100644
--- a/client/src/pages/Apps.test.jsx
+++ b/client/src/pages/Apps.test.jsx
@@ -40,7 +40,7 @@ vi.mock('../services/api', () => ({
}));
vi.mock('../components/ui/Toast', () => ({
- default: { success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), custom: vi.fn() }
+ default: { success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn() }
}));
vi.mock('../services/socket', () => ({
diff --git a/client/src/pages/CreateApp.test.jsx b/client/src/pages/CreateApp.test.jsx
index 6c82a63ff2..a27f35ef2b 100644
--- a/client/src/pages/CreateApp.test.jsx
+++ b/client/src/pages/CreateApp.test.jsx
@@ -22,7 +22,7 @@ vi.mock('../services/api', () => ({
}));
vi.mock('../components/ui/Toast', () => ({
- default: { success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), custom: vi.fn() }
+ default: { success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn() }
}));
import CreateApp from './CreateApp';
diff --git a/client/src/pages/SystemHealthPage.test.jsx b/client/src/pages/SystemHealthPage.test.jsx
index 3ecf894bec..07e549cc7d 100644
--- a/client/src/pages/SystemHealthPage.test.jsx
+++ b/client/src/pages/SystemHealthPage.test.jsx
@@ -50,7 +50,7 @@ vi.mock('../hooks/useProviderModels', () => ({
vi.mock('../components/ui/Toast', () => {
const toast = Object.assign(vi.fn(), {
- success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn(), custom: vi.fn()
+ success: vi.fn(), error: vi.fn(), loading: vi.fn(), dismiss: vi.fn()
});
return { default: toast };
});
diff --git a/client/src/services/apiCreativeDirector.js b/client/src/services/apiCreativeDirector.js
index f6ac752195..0a431edc9f 100644
--- a/client/src/services/apiCreativeDirector.js
+++ b/client/src/services/apiCreativeDirector.js
@@ -7,8 +7,8 @@ export const getCreativeDirectorSources = (id, options = {}) => request(`/creati
// (status / per-scene status / finalVideoId / failureReason / updatedAt) —
// drops the `runs[]` history and the full treatment text. Useful
// for 4s-poll surfaces like the Pipeline EpisodeVideoStage.
-export const getCreativeDirectorProject = (id, { slim = false } = {}) =>
- request(`/creative-director/${encodeURIComponent(id)}${slim ? '?slim=1' : ''}`);
+export const getCreativeDirectorProject = (id, { slim = false, ...options } = {}) =>
+ request(`/creative-director/${encodeURIComponent(id)}${slim ? '?slim=1' : ''}`, options);
// Batch fetch projects by id (#4148) — the `ids` filter rides the normal list
// endpoint, so the response is the same full, non-slim project shape previews
// compute from. Used by surfaces that reference a known handful of projects
diff --git a/client/src/services/apiProviders.js b/client/src/services/apiProviders.js
index dd072b416a..32e833ce8f 100644
--- a/client/src/services/apiProviders.js
+++ b/client/src/services/apiProviders.js
@@ -194,7 +194,7 @@ export const serveProviderModel = (id, options) => request(
);
// Provider status (usage limits, availability)
-export const getProviderStatuses = () => request('/providers/status');
+export const getProviderStatuses = (options) => request('/providers/status', options);
export const recoverProvider = (id, options) => request(`/providers/${id}/status/recover`, { method: 'POST', ...options });
// Codex / ChatGPT subscription account (#5589). The Codex app-server owns the
diff --git a/docs/features/app-quality.md b/docs/features/app-quality.md
index ae0b27d237..49d94c1f74 100644
--- a/docs/features/app-quality.md
+++ b/docs/features/app-quality.md
@@ -94,6 +94,20 @@ partition pruning, cold start), `api-contract` (framework-neutral; spec drift,
breaking changes, idempotency keys, pagination bounds), `observability`
(correlation, alertable metrics, truthful health, audit trails) and
`data-safety` (backup restorability, bulk/backfill safety, retention reach).
+
+Two gap lenses cover defects every page-walking and code-shape audit reads as
+intentional or never reaches:
+
+| Category | Owns | Distinct from |
+| --- | --- | --- |
+| `feature-completeness` | Work started and never finished: stubs and 501s reachable from the UI, permanently disabled or "coming soon" controls, UI/doc promises the code does not keep, settings nothing reads, capabilities with no entry point, server events nobody hears, deferred work with no live tracker item. Decides finish, hide, or remove | `simplify` (code with no user meaning), `ui-bugs` (finished controls that fail) |
+| `workflow-recovery` | Multi-step workflows judged from the server's in-progress states: a visible resume/cancel/reattach exit after a failed follow-up step or a reload, busy refusals that carry the holder's id, waits that time out, duplicate-preventing markers kept on the server | `ui-bugs` (one click on a fresh page), `error-handling` (per-call failures), `reliability` (process restart) |
+
+Both default to file-issues and apply to any repository. Deterministic
+contract breaks in untyped client code (a call to a member the imported module
+lacks, a test mock defining members the real module lacks, a browser
+`confirm()`) are not left to an audit: `client/src/moduleContractConventions.test.js`
+fails CI on them.
Real-user product outcomes such as retention or satisfaction cannot be inferred
reliably from a source audit and are not fabricated into this codebase score.
A future distinct category must register both its scheduled prompt and a
diff --git a/docs/features/scheduled-audit-organization.md b/docs/features/scheduled-audit-organization.md
index 6e8e2f67a2..11c1578349 100644
--- a/docs/features/scheduled-audit-organization.md
+++ b/docs/features/scheduled-audit-organization.md
@@ -13,7 +13,8 @@ better-error-handling, better-typing, better-console-errors, better-ux,
better-data-safety, better-simplify, better-module-hygiene, better-api-contract,
better-ui-lifecycle, better-observability, and better-copy, plus the service
and data-platform lenses better-infrastructure, better-data-integrity,
-better-reliability, better-privacy, and better-cost-efficiency. The existing
+better-reliability, better-privacy, and better-cost-efficiency, and the gap
+lenses better-feature-completeness and better-workflow-recovery. The existing
better-* names, including better-dev-environment, remain unchanged.
Operational tasks (claims, review pipelines, reconciliation, releases, repo sync),
diff --git a/docs/features/self-improvement-audits.md b/docs/features/self-improvement-audits.md
index 6bd4522189..de59080a6a 100644
--- a/docs/features/self-improvement-audits.md
+++ b/docs/features/self-improvement-audits.md
@@ -58,6 +58,8 @@ the operator's live checkout.
| `reliability` | Shutdown, health checks, backpressure, job leasing, mixed-version deploys | `resilience`, `reliability` | file | |
| `privacy` | Exposure, minimization, retention and erasure of personal data | `privacy` | file | |
| `cost-efficiency` | Metered spend: paid calls, unbounded scans, over-provisioning | `performance`, `cost` | file | |
+| `feature-completeness` | Work started and never finished, offered to users anyway | `bug`, `incomplete` | file | |
+| `workflow-recovery` | Multi-step workflows that strand their record between steps | `bug`, `workflow` | file | |
## Why the boundaries are explicit
diff --git a/scripts/ci-test-plan.js b/scripts/ci-test-plan.js
index bea066c89d..d0ab73c756 100644
--- a/scripts/ci-test-plan.js
+++ b/scripts/ci-test-plan.js
@@ -477,6 +477,7 @@ const structuralTestsFor = (changedFiles, trackedSet) => {
add('client/src/globalShadowConventions.test.js');
add('client/src/headingTruncationConventions.test.js');
add('client/src/hooks/mountedRefConventions.test.js');
+ add('client/src/moduleContractConventions.test.js');
add('client/src/numberFormattingConventions.test.js');
add('client/src/pollingConventions.test.js');
add('client/src/popoverClampConventions.test.js');
diff --git a/scripts/repo-scan-guards.test.js b/scripts/repo-scan-guards.test.js
index 373d1f6f66..055d7ebcbe 100644
--- a/scripts/repo-scan-guards.test.js
+++ b/scripts/repo-scan-guards.test.js
@@ -58,6 +58,7 @@ const STRUCTURALLY_SELECTED = new Map([
['client/src/globalShadowConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/headingTruncationConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/hooks/mountedRefConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
+ ['client/src/moduleContractConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/numberFormattingConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/pollingConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
['client/src/popoverClampConventions.test.js', 'structuralTestsFor: client/src/**.js(x)'],
diff --git a/server/lib/auditCatalog.js b/server/lib/auditCatalog.js
index 298a7d5725..b18b339dfb 100644
--- a/server/lib/auditCatalog.js
+++ b/server/lib/auditCatalog.js
@@ -573,6 +573,39 @@ export const AUDIT_DEFINITIONS = Object.freeze({
noun: 'cost finding(s)',
}),
},
+ // Work that was started and never finished: stubs reachable from the UI,
+ // permanently disabled controls, settings nothing reads. Every other lens
+ // reads these as intentional (simplify would delete them, ui-bugs sees
+ // nothing "broken"), so they need an owner that decides finish/hide/remove.
+ 'feature-completeness': {
+ quotaBurnId: null,
+ label: 'Feature completeness',
+ description: 'Incomplete-feature audit (stubs reachable from the UI, disabled or "coming soon" controls, settings nothing reads, capabilities with no entry point) — configurable: file issues (default) or finish one',
+ defaultFileIssues: true,
+ filing: filing({
+ slugPrefix: 'incomplete-',
+ label: 'feature-completeness-audit',
+ issueLabel: 'bug',
+ labelDescription: 'Proposed from an incomplete-feature audit',
+ noun: 'incomplete-feature finding(s)',
+ }),
+ },
+ // Multi-step workflows judged from the server's in-progress states: each
+ // needs a visible resume/cancel/reattach exit after a failed follow-up step
+ // or a reload. A page walk exercises one click and never sees this.
+ 'workflow-recovery': {
+ quotaBurnId: null,
+ label: 'Workflow recovery',
+ description: 'Workflow completion and recovery audit (stranded in-progress states, busy refusals without a handle, client follow-up steps that fail after the server succeeded) — configurable: file issues (default) or implement fixes',
+ defaultFileIssues: true,
+ filing: filing({
+ slugPrefix: 'workflow-',
+ label: 'workflow-recovery-audit',
+ issueLabel: 'bug',
+ labelDescription: 'Proposed from a workflow completion and recovery audit',
+ noun: 'workflow-recovery finding(s)',
+ }),
+ },
});
export const AUDIT_TASK_TYPES = new Set(Object.keys(AUDIT_DEFINITIONS));
@@ -762,11 +795,11 @@ export const DO_BETTER_SCOPE_COVERAGE = Object.freeze({
'code-quality': ['code-quality', 'observability'],
dry: ['simplify'],
architecture: ['module-hygiene', 'api-contract'],
- 'bugs-perf': ['better-runtime-safety', 'performance', 'error-handling', 'observability', 'reliability', 'cost-efficiency'],
+ 'bugs-perf': ['better-runtime-safety', 'performance', 'error-handling', 'observability', 'reliability', 'cost-efficiency', 'workflow-recovery'],
'stack-specific': ['ui-lifecycle', 'accessibility', 'data-safety', 'security', 'infrastructure', 'data-integrity'],
deps: ['better-dependency-freedom', 'security'],
tests: ['test-coverage', 'better-test-quality', 'better-dev-environment'],
- ux: ['ux', 'mobile-responsive', 'copy'],
+ ux: ['ux', 'mobile-responsive', 'copy', 'feature-completeness'],
structural: ['module-hygiene', 'better-structural-drift', 'simplify'],
'cognitive-load': ['better-cognitive-load', 'better-complexity'],
});
@@ -821,7 +854,7 @@ export const AUDIT_SUGGESTED_AFTER = Object.freeze({
'better-dev-environment': Object.freeze(['better-test-quality']),
// The restructuring ladder: consolidate sources of truth, delete what is
// dead, then draw module boundaries, then reduce what survives.
- simplify: Object.freeze(['better-structural-drift']),
+ simplify: Object.freeze(['better-structural-drift', 'feature-completeness']),
'module-hygiene': Object.freeze(['simplify']),
'better-dependency-freedom': Object.freeze(['module-hygiene']),
'better-complexity': Object.freeze(['module-hygiene']),
@@ -834,6 +867,7 @@ export const AUDIT_SUGGESTED_AFTER = Object.freeze({
// handling; spend after latency, since a performance fix often moves cost.
infrastructure: Object.freeze(['security']),
reliability: Object.freeze(['error-handling']),
+ 'workflow-recovery': Object.freeze(['error-handling']),
'cost-efficiency': Object.freeze(['performance']),
});
@@ -863,4 +897,6 @@ export const AUDIT_RUN_GUIDANCE = Object.freeze({
infrastructure: 'Follows the code-level security pass, so deployment findings (exposure, credentials, unpinned images) do not duplicate what it already filed.',
reliability: 'Follows call-level failure handling: once each call fails safely, look at how the service as a whole restarts, drains, and sheds load.',
'cost-efficiency': 'Follows performance, because a latency fix often changes what the path costs; measure spend on the shape that survived.',
+ 'feature-completeness': 'Runs before simplify sweeps unreferenced code, so an unfinished feature is decided (finish, hide, or remove) rather than silently deleted.',
+ 'workflow-recovery': 'Follows call-level failure handling: once each step fails safely, check that a workflow stopped between steps still offers the user a way to finish or cancel it.',
});
diff --git a/server/lib/auditQuality.js b/server/lib/auditQuality.js
index 9d44c6b2fd..c2d60ae735 100644
--- a/server/lib/auditQuality.js
+++ b/server/lib/auditQuality.js
@@ -36,6 +36,8 @@ export const AUDIT_DISCOVERY = Object.freeze({
'data-integrity': 'Inventory every write path, ingestion entry point, consumer, batch/backfill job and stored data format; trace retry and redelivery behavior and multi-step writes, ranking silent duplication, loss and wrong results first.',
reliability: 'Inventory process entry points, signal handling, health endpoints, queues, workers and scheduled jobs; trace shutdown, restart, overload and multi-instance behavior, ranking dropped work and outage amplification first.',
privacy: 'Inventory personal and sensitive fields in schemas and payloads, then trace them to logs, errors, analytics, caches, exports, third-party calls and deletion paths; rank exposure already happening over missing governance.',
+ 'feature-completeness': 'Scan for not-implemented/501/placeholder returns, permanently disabled or "coming soon" controls, settings written but never read, endpoints and jobs with no caller, server events with no listener, and to-do references to missing or closed tracker items; trace each to the control or document that offers it, ranking what users are offered today over internal gaps.',
+ 'workflow-recovery': 'Inventory server-side in-progress states (persisted statuses, in-memory locks and in-flight maps, leases, "already in progress" refusals) and the client chains that drive them; trace each state to the page that must show it and its resume/cancel/reattach exit, ranking records left blocked with no visible exit first.',
'cost-efficiency': 'Inventory metered dependencies (paid APIs, model providers, cloud storage/query/compute, egress) and their call sites, schedules and retry paths; rank spend by frequency times unit cost and growth with usage.',
});
diff --git a/server/lib/scheduledTaskTypes.js b/server/lib/scheduledTaskTypes.js
index 25b5baeb52..f4ea460626 100644
--- a/server/lib/scheduledTaskTypes.js
+++ b/server/lib/scheduledTaskTypes.js
@@ -128,6 +128,14 @@ export const SELF_IMPROVEMENT_TASK_TYPES = [
// Metered spend: paid API/model calls, unbounded cloud scans, storage tiers,
// over-provisioning. Distinct from `performance` (latency and throughput).
'cost-efficiency',
+ // Work started and never finished: stubs reachable from the UI, disabled or
+ // "coming soon" controls, settings nothing reads. Decides finish/hide/remove.
+ // Distinct from `simplify`, which deletes code with no user meaning.
+ 'feature-completeness',
+ // Multi-step workflows that strand their record when a follow-up step fails
+ // or the tab reloads. Distinct from `ui-bugs` (one click on a fresh page) and
+ // `error-handling` (per-call failure handling).
+ 'workflow-recovery',
// Audits `git stash list` for {appName} and drops entries already superseded
// by (or a subset of) current `main`/HEAD, or that are stale/abandoned scratch
// work — without discarding real unlanded work. On-demand only (no cadence
diff --git a/server/services/taskPromptDefaults.test.js b/server/services/taskPromptDefaults.test.js
index da316de946..3bfb2a56cc 100644
--- a/server/services/taskPromptDefaults.test.js
+++ b/server/services/taskPromptDefaults.test.js
@@ -84,21 +84,53 @@ describe('taskPromptDefaults integrity snapshot', () => {
it('ux filings use tracker IDs instead of title slugs', () => {
const current = DEFAULT_TASK_PROMPTS.ux;
- expect(PROMPT_VERSIONS.ux).toBe(5);
+ expect(PROMPT_VERSIONS.ux).toBe(6);
expect(current).toContain('{trackerInstructions}');
expect(current).toContain('short, human-readable title');
expect(current).not.toContain('[ux-…]');
expect(current).not.toContain('slug-tagged title');
});
- it('ux v5 checks wordy instructions, duplicate controls, and information hidden when needed', () => {
+ it('ux checks wordy instructions, duplicate controls, and information hidden when needed', () => {
const current = DEFAULT_TASK_PROMPTS.ux;
expect(current).toContain('**Text earns its space.**');
expect(current).toContain('**One control per action.**');
expect(current).toContain('**What the user needs now is visible now.**');
- expect(current).toContain('checklist item (1–11)');
- expect(current).toContain('Items 9–11 are not aesthetic preferences');
+ expect(current).toContain('checklist item (1–13)');
+ expect(current).toContain('Items 9–13 are not aesthetic preferences');
+ });
+
+ // v6: the Music Video editor shipped double-padded with no "where it stands"
+ // line and no render preview, and no run caught it — the audit only walked
+ // top-level nav routes and had no item for record state or page framing.
+ it('ux v6 reaches record pages mid-workflow and checks record state and page framing', () => {
+ const current = DEFAULT_TASK_PROMPTS.ux;
+
+ expect(current).toMatch(/detail or editor\s+route/);
+ expect(current).toMatch(/partway through its workflow/);
+ expect(current).toContain('Rotate coverage');
+ expect(current).toContain('**A record page says where it stands.**');
+ expect(current).toContain('**Same kind of page, same frame.**');
+ });
+
+ it('ui-bugs v4 hunts unhappy paths and statically provable crashes', () => {
+ const current = DEFAULT_TASK_PROMPTS['ui-bugs'];
+
+ expect(PROMPT_VERSIONS['ui-bugs']).toBe(4);
+ expect(current).toContain('**Unhappy paths of primary actions**');
+ expect(current).toContain('**Statically provable crashes**');
+ expect(current).toContain('workflow-recovery work');
+ });
+
+ it.each([
+ ['feature-completeness', ['Stubs reachable from the interface', 'Decide, do not defer', 'Static evidence is enough']],
+ ['workflow-recovery', ['Work from server state, not from views', 'Disabled controls say why', 'id of what holds it']],
+ ])('%s v1 states what makes it its own lane', (key, markers) => {
+ const current = DEFAULT_TASK_PROMPTS[key];
+ expect(PROMPT_VERSIONS[key]).toBe(1);
+ expect(current).toContain('{modeInstructions}');
+ for (const marker of markers) expect(current, key).toContain(marker);
});
it('module-hygiene v1 is generic, evidence-led, and bounded', () => {
@@ -171,7 +203,8 @@ describe('taskPromptDefaults integrity snapshot', () => {
['better-dev-environment', ['Measure, do not only read', 'before and after', 'Prefer a guard to a patch', 'Not yours']],
])('%s states the discipline that makes it its own lane', (key, markers) => {
const current = DEFAULT_TASK_PROMPTS[key];
- expect(PROMPT_VERSIONS[key]).toBe(['better-complexity', 'better-runtime-safety'].includes(key) ? 2 : 1);
+ const versions = { 'better-complexity': 2, 'better-runtime-safety': 3, 'better-test-quality': 2 };
+ expect(PROMPT_VERSIONS[key]).toBe(versions[key] ?? 1);
for (const marker of markers) expect(current, key).toContain(marker);
});
diff --git a/server/services/taskPromptDefaults/integrity.snapshot.json b/server/services/taskPromptDefaults/integrity.snapshot.json
index 67bb145294..da1dd27090 100644
--- a/server/services/taskPromptDefaults/integrity.snapshot.json
+++ b/server/services/taskPromptDefaults/integrity.snapshot.json
@@ -7,9 +7,9 @@
"better-complexity": "c99f67b43ff54a1c8cf0176c721d9c06",
"better-dependency-freedom": "8a79c8be829f926bbc7720ee29818d53",
"better-dev-environment": "62523b82066e70ff1c786da22ccf0372",
- "better-runtime-safety": "1038ac5008cb52e418460f53f262ad22",
+ "better-runtime-safety": "444c7104f32a8cd1c1ddb7a15b275512",
"better-structural-drift": "941389a1f1c8983eef4f87af1241fbf9",
- "better-test-quality": "ab53a477cd194a5c4fbda09d901a3775",
+ "better-test-quality": "8e305f986e9c9066da5db2aee76fc024",
"branch-cleanup": "8fdeb4acc2749816a47ca318b6602721",
"branch-reconcile": "ae6e8164698faebc2a5fd4fecb3d41e8",
"claim-issue": "2663933c28056e0e23caf42acb1b41d0",
@@ -28,6 +28,7 @@
"do-replan": "35660eb7b43e4259a6a9253ed288a1db",
"documentation": "a30e3bfba8cd13369ccaf806a3534a79",
"error-handling": "137b371f38398042c0a2c7e2279c92ce",
+ "feature-completeness": "00d8916cc6032e74817657375375115b",
"feature-ideas": "804f62f1dadadbfa8a0bcd4aff16b2e8",
"infrastructure": "b4ad755eb115b82679c601a0df1ffd7b",
"issue-reconcile": "716c87476d77d7e4f98613dadc06f228",
@@ -53,14 +54,15 @@
"reliability": "2a99be77b8f34653f4b926db0a773ea5",
"repo-sync": "0a648d35d43b023b758226b9c709c8ea",
"security": "4bd26243a5792a39040da0b49321ca27",
- "simplify": "2a048214d1dd3b75bee9ae1a38fa1589",
+ "simplify": "3144f78ff48104926f5fce059dc3f7ff",
"stash-cleanup": "1c12bac5aac6bb27008c40981e7db08c",
"test-coverage": "36beffc0c2959be5d818ded54b3fe298",
"typing": "bd7cb874b2784395280b116369c7e7ac",
- "ui-bugs": "073bea13a94b0266c53b5f55bb2344b9",
+ "ui-bugs": "06baf650e41fce12aaa59c66030c0357",
"ui-lifecycle": "d2eaa653e57897d3fb8b6c52c2c18e38",
"user-action-review": "1a083430e43f60cdd586cfffbdebc583",
- "ux": "9f346b8be4408c5a8207d9a8b6080ff0"
+ "ux": "bb8670c1e6eb28434ad2d45b6dc62177",
+ "workflow-recovery": "628d2ec51c3cd3d8bbd76eacb212dada"
},
"PROMPT_VERSIONS": {
"accessibility": 5,
@@ -70,9 +72,9 @@
"better-complexity": 2,
"better-dependency-freedom": 1,
"better-dev-environment": 1,
- "better-runtime-safety": 2,
+ "better-runtime-safety": 3,
"better-structural-drift": 1,
- "better-test-quality": 1,
+ "better-test-quality": 2,
"branch-reconcile": 7,
"claim-issue": 38,
"claim-issue-gitlab": 34,
@@ -90,6 +92,7 @@
"do-replan": 2,
"documentation": 7,
"error-handling": 3,
+ "feature-completeness": 1,
"feature-ideas": 11,
"infrastructure": 1,
"issue-reconcile": 8,
@@ -111,14 +114,15 @@
"reliability": 1,
"repo-sync": 1,
"security": 4,
- "simplify": 1,
+ "simplify": 2,
"stash-cleanup": 2,
"test-coverage": 3,
"typing": 3,
- "ui-bugs": 3,
+ "ui-bugs": 4,
"ui-lifecycle": 2,
"user-action-review": 2,
- "ux": 5
+ "ux": 6,
+ "workflow-recovery": 1
},
"REFERENCE_WATCH_AUDITED_VERSION": 4,
"PREVIOUS_DEFAULT_PROMPTS": {
@@ -145,7 +149,11 @@
"c92b99080d0453d70bb26a412fb48ce9"
],
"better-runtime-safety": [
- "4259ab85dd3eaf8efb16a250187bd857"
+ "4259ab85dd3eaf8efb16a250187bd857",
+ "1038ac5008cb52e418460f53f262ad22"
+ ],
+ "better-test-quality": [
+ "ab53a477cd194a5c4fbda09d901a3775"
],
"branch-reconcile": [
"7ef2b5f7d8f05937d4912b26ad45f42e",
@@ -397,6 +405,9 @@
"8e58c1305a391ac765b0b13ab9615eb3",
"c5e35a12eeb06e6afe4617f4428fa1ab"
],
+ "simplify": [
+ "2a048214d1dd3b75bee9ae1a38fa1589"
+ ],
"stash-cleanup": [
"f9de8b10937919ceb6656fbdb70179c4"
],
@@ -411,7 +422,8 @@
],
"ui-bugs": [
"01d2a7e034713195f33071f2c71a3c99",
- "def9ad96bd74ab397233f234d79a1974"
+ "def9ad96bd74ab397233f234d79a1974",
+ "073bea13a94b0266c53b5f55bb2344b9"
],
"ui-lifecycle": [
"14b3816d1bcc10f0d7d6357e55cc5e69"
@@ -423,7 +435,8 @@
"e03d03fc7c16faa5b5db93be2896b9ad",
"ac11f692eae40ffe8ddeaeaccbcf75e9",
"b8c0bde4075685625443a405b2c70b50",
- "f90b5f38a7c6264e0d40919a2933ba4c"
+ "f90b5f38a7c6264e0d40919a2933ba4c",
+ "9f346b8be4408c5a8207d9a8b6080ff0"
]
}
}
diff --git a/server/services/taskPromptDefaults/prompts.js b/server/services/taskPromptDefaults/prompts.js
index ea17d1ec05..dd4ca58f3a 100644
--- a/server/services/taskPromptDefaults/prompts.js
+++ b/server/services/taskPromptDefaults/prompts.js
@@ -721,7 +721,8 @@ requests, and interact with the primary controls rather than only looking at the
page.
If the interface is not reachable, exit cleanly and say so. Do not file
-speculative findings from source alone.
+speculative findings from source alone; a defect proven by reading both sides
+of a call (see "Statically provable crashes" below) is not speculative.
## Hunt for
@@ -738,13 +739,26 @@ speculative findings from source alone.
leaves the view stale until reload, or a list that loses its selection.
- **Navigation defects** — a route that 404s, a deep link that lands somewhere
else, a back navigation that loses state it should keep.
+- **Unhappy paths of primary actions** — the not-found, empty-input, conflict,
+ and failure branch of each primary control, not only its success path. A
+ handler that throws only on its error branch is invisible to a happy-path
+ walk, so trigger that branch deliberately.
+- **Statically provable crashes** — where no type checker runs, a call to a
+ member the imported module does not define, or a named import it does not
+ export, on a path a control reaches. Reading the callee's real export is the
+ proof; name the control that reaches it. When one module's contract is
+ broken at several call sites, file one finding for the class and propose a
+ mechanical guard rather than one fix per site.
## Not yours
Viewport and layout breakage at small sizes belongs to the mobile and responsive
work; keyboard, contrast, and screen-reader barriers to the accessibility work;
-design and flow judgments to the UX work; wording to the copy work. This audit
-owns things that are broken, not things that could be better.
+design and flow judgments to the UX work; wording to the copy work; a
+multi-step workflow that strands its record after a failure or reload to the
+workflow-recovery work; a control that was never finished to the
+incomplete-feature work. This audit owns things that are broken, not things
+that could be better.
For each finding: the view, the exact steps to reproduce, what happens, what
should happen, and the \`file:LINE\` of the cause once you have traced it.`,
@@ -824,6 +838,8 @@ Duplicate findings are noise. Do NOT file:
- **Touch-only mechanics** (hover-only controls and tap-target sizing) — \`mobile-responsive\` owns these. Responsive layout failures ARE part of this UX audit; deduplicate against findings from that sibling task.
- **ARIA labels, contrast ratios, keyboard traps** — \`accessibility\` owns these.
- **The wording of a single string** (jargon, an ambiguous verb, broken plurals) — \`copy\` owns it. How MUCH text a screen spends explaining itself, and whether it repeats what the controls already say, is this audit's (checklist item 9).
+- **A workflow that cannot be resumed or cancelled after a failure or reload** — \`workflow-recovery\` owns it. Whether the page tells the user where a record stands is this audit's (checklist item 12).
+- **A control that is permanently disabled or "coming soon"** — \`feature-completeness\` owns it.
Mention an overlap only when it is the *cause* of a UX failure you are filing
(e.g. "the empty state is unreachable because the only trigger is a
@@ -842,7 +858,14 @@ keyboard-inaccessible icon") — and file it as the UX finding, not as the a11y
output. If the UI is not reachable, exit cleanly and say so in your summary;
do NOT file speculative findings from source alone.
-3. **Walk each main route** with Playwright MCP. For every route:
+3. **Choose routes, then walk them.** Main navigation routes alone are not
+ enough: most work happens on record pages. Also open the detail or editor
+ route (the \`/:id\` view) of each domain that has records, choosing a record
+ partway through its workflow — in progress, awaiting review, failed — over a
+ fresh or finished one. Rotate coverage: prefer routes and domains with no
+ finding from this audit in the tracker in the last 30 days, and list the
+ routes you chose and why. Describe records by their state, never by their
+ names or contents. Walk each chosen route with Playwright MCP. For every route:
- \`browser_navigate\` to it, then \`browser_snapshot\` to read the structure.
- \`browser_resize\` to **1440x900**, **1280x800**, **1024x768**, **768x1024**, **390x844**, and **320x812** and
snapshot at each — the fold differs, and a buried primary action is the
@@ -853,6 +876,8 @@ keyboard-inaccessible icon") — and file it as the UX finding, not as the a11y
- Inspect empty, populated, loading, and error states with synthetic long names, URLs, and action labels. Check bounding rectangles and scrollWidth/clientWidth on the page AND cards: overflow-hidden can conceal unreachable controls even when the document has no horizontal scrollbar. Exempt only intentional local scroll regions such as tables/timelines; verify their keyboard access.
- Record route/widget, viewport AND container width, state, sidebar mode, blocked action, and responsible component. Report unvisited routes/states as untested, never as passing.
- Read the screen as a user, not only its geometry. From the snapshot, list every visible action with what it does, and every block of instructional or explanatory text longer than one sentence. Then reach the states where a user needs particular information (a failed run, a blocked step, a pending decision, a record just created) and note what is visible there without an extra click. These inventories are the evidence for checklist items 9–11.
+ - On a record page, write down in one sentence where the record stands and what the user should do next, using only what is visible above the fold. If you cannot, that is the evidence for checklist item 12.
+ - Compare the page's frame with a sibling page of the same family: where the header sits, the outer padding, the maximum width, and which element scrolls. Evidence for checklist item 13.
4. **Evaluate each route against this named checklist.** Cite the checklist
number in the finding so results are reproducible rather than vibes:
@@ -898,6 +923,22 @@ keyboard-inaccessible icon") — and file it as the UX finding, not as the a11y
is also a finding: a status the user cannot act on that stays expanded
and dominates the screen. Name the state, where the information is
hidden, and the click count to reach it.
+ 12. **A record page says where it stands.** A record that moves through
+ stages (a project, a pipeline, a run, an import) shows, above the fold
+ and without a click, its current stage, whether it is waiting on the
+ user, and the one next action — and gives a way to see, play, or open
+ its primary output (the render, the document, the result) from wherever
+ the user is on that page. A finding is a status readable only as a raw
+ enum or id, a stage strip with no "you are here", a next step the user
+ must infer from a row of cards, or output reachable only from one tab.
+ 13. **Same kind of page, same frame.** Pages of one family share the app's
+ page shell: header placement, outer padding, maximum width, and a single
+ scroll container. A page whose header is inset, whose padding is
+ doubled, or whose content scrolls inside a second scroller, compared
+ with its siblings, is a finding. This item may be proven statically as
+ well as from the snapshot: compare the route's shell or layout
+ configuration and the page's root container with its siblings', and
+ check that a detail route (\`/:id\`) gets the same shell as its index.
5. **File ONE item per finding** using the "Record" mechanics under "Where to
record findings" above. Each finding must carry:
@@ -905,7 +946,7 @@ keyboard-inaccessible icon") — and file it as the UX finding, not as the a11y
- **A short, human-readable title** naming the screen and the problem. Do
not invent an issue ID or add a slug/category/severity tag to a forge
title; follow the selected tracker's ID convention from its instructions.
- - **The screen/route** you audited and which checklist item (1–11) it failed.
+ - **The screen/route** you audited and which checklist item (1–13) it failed.
- **What the user is trying to do** on that screen.
- **Why the current design impedes it** — 1–2 sentences, concrete and
observable, referencing what you saw in the snapshot.
@@ -921,8 +962,9 @@ keyboard-inaccessible icon") — and file it as the UX finding, not as the a11y
Be selective — file the findings that would measurably change whether a user
succeeds, not every aesthetic preference. A handful of well-argued items
- beats twenty nitpicks. Items 9–11 are not aesthetic preferences: a wall of
- instructions, a duplicated button, or a hidden error each costs the user
+ beats twenty nitpicks. Items 9–13 are not aesthetic preferences: a wall of
+ instructions, a duplicated button, a hidden error, a record whose state the
+ user cannot read, or a page framed unlike its siblings each costs the user
reading time, a wrong guess, or a dead end, so file them when you see them.
When one component causes the same item on several screens, file one
finding that lists the screens.
@@ -1010,7 +1052,13 @@ Hunt specifically for:
Cross-version and cross-install compatibility code is NOT dead code, even when
this install no longer hits it. Read the project's rules on migrations and
-version gates before proposing any such removal.`,
+version gates before proposing any such removal.
+
+An unreferenced endpoint, setting, or job that does user-meaningful work may be
+an unfinished feature rather than dead code — check whether documentation,
+interface text, or a plan describes it. If one does, it belongs to the
+incomplete-feature work, which decides whether to finish or remove it; do not
+file a deletion here.`,
'module-hygiene': `[Improvement: {appName}] Module hygiene audit
@@ -1535,6 +1583,12 @@ Repository: {repoPath}
condition provably off by one for a stated input.
- **Process-killing calls in reusable code** — exiting the process from a module
a library or test can import.
+- **Cross-module contract breaks in untyped code** — where no type checker
+ runs, a call to a member the imported object does not define, a named import
+ the module does not export, or an argument at a position the callee never
+ reads (an options object a wrapper silently drops). Read the callee's actual
+ export, not its name. A class of these across many call sites is one
+ finding, and its fix includes a mechanical guard test.
## Not yours — name the overlap and move on
@@ -1659,6 +1713,11 @@ there.
- Cases sharing mutable state, so they pass only in one order.
- A guard or safety test that never probes the bypass — it asserts the guard
allows the good case but never proves it blocks the bad one.
+- Mocks that drift from the module they replace — a mock defining a member,
+ export, or response shape the real module does not have, so the suite passes
+ against a contract production code cannot meet. Compare each widely used
+ mock's keys with the real export; one drifted mock repeated across many
+ suites is one finding.
**Redundant — the test is real but earns nothing:**
@@ -2042,6 +2101,138 @@ For each finding give \`file:LINE\`, the cost driver, the estimate with its
assumptions, the proposed change, and the expected saving. Reject changes that
save pennies at the cost of correctness or clarity.`,
+ 'feature-completeness': `[Improvement: {appName}] Incomplete-feature audit
+
+Find what {appName} offers, documents, or half-built that does not actually work
+end to end — and decide, for each, whether to finish it, hide it, or remove it.
+
+Repository: {repoPath}
+
+{modeInstructions}
+
+Other audits look for code that is broken or dead. This one looks for work that
+was started and never finished: a control that is permanently disabled, a path
+that ends in "not implemented", a setting that saves and changes nothing. Every
+other lens reads these as intentional, so they survive run after run.
+
+## Hunt for
+
+- **Stubs reachable from the interface** — a handler, service, or adapter that
+ returns "not implemented", a 501, a placeholder or hardcoded result, or throws
+ a to-do error, on a path a user can trigger. Trace from the visible control to
+ the stub. A stub nothing reaches is dead code, not yours.
+- **Controls that can never work** — a button, tab, menu entry, or option that
+ is permanently disabled, labeled "coming soon" or "not available yet", or
+ wired to a no-op handler.
+- **Promises the code does not keep** — interface text, help copy, or
+ documentation describing behavior the implementation lacks or does
+ differently ("restarts the process" where the code only stages a patch).
+- **Settings that change nothing** — a value the interface saves that no runtime
+ path reads, or a runtime option with a real effect that no interface or
+ documented configuration can set.
+- **Capabilities with no entry point** — an endpoint, job, or repair routine that
+ does user-meaningful work but has no caller, interface, schedule, or
+ documented invocation, so the work it exists for never happens.
+- **Events nobody hears** — a server event announcing something the user should
+ see (an approval is needed, a sync needs a login, health turned critical) with
+ no client listener, so the user learns only on a manual reload.
+- **Plans that disagree with the code** — a plan or tracker item marked done or
+ in progress whose acceptance criteria the code does not meet, or one still
+ marked pending for work that has shipped.
+- **Deferred work with no live tracker item** — a to-do comment, disabled
+ feature, or "not supported yet" message that cites no tracker reference, or
+ one that does not exist, is closed, or belongs to another project.
+
+## Decide, do not defer
+
+Every finding ends in a decision, not a question:
+
+- **Finish** — name the missing piece, the files it touches, and how to verify
+ it. Prefer this when the remaining work is small or the feature is documented.
+- **Hide until it works** — stop offering the control, option, or account type,
+ and file the finishing work. Prefer this when finishing is large and the
+ current surface misleads users today.
+- **Remove** — delete the stub and every surface that offers it, when the
+ feature is no longer wanted.
+
+## Not yours
+
+Code with no caller and no user meaning belongs to the simplification work.
+Controls that were finished and now fail belong to the UI-bug work. Wording
+belongs to the copy work. A workflow that starts but cannot be resumed or
+cancelled belongs to the workflow-recovery work.
+
+## The bar
+
+Show the path: the entry point (control, document, setting) with
+\`file:LINE\`, the place the work stops with \`file:LINE\`, and what the user
+experiences. Static evidence is enough here — a stub, a hardcoded disabled
+flag, or a setting nothing reads is proven by reading the code; it does not need
+a live reproduction. Never quote a user's records when describing what is
+offered.`,
+
+ 'workflow-recovery': `[Improvement: {appName}] Workflow completion and recovery audit
+
+Find the multi-step workflows in {appName} that can stop halfway and leave the
+user with no visible way to finish, resume, or cancel them.
+
+Repository: {repoPath}
+
+{modeInstructions}
+
+A page walk exercises one click on a fresh page. This audit exercises the
+sequence: a request that opens a revision, then a second step that finalizes
+it; a job started in one tab and watched from another; a run that waits for an
+event. The defect lives in the gap between steps, so it is invisible until a
+step fails, a tab reloads, or the server restarts.
+
+## Work from server state, not from views
+
+1. **Inventory every in-progress state the server can hold:** persisted
+ statuses (open, pending, running, rendering, generating, awaiting review),
+ in-memory locks and in-flight maps, leases and claims, and every response
+ that refuses work because something is "already in progress".
+2. **For each state, check three exits:**
+ - The page that owns the record detects the state on load and shows it in
+ a visible, expanded place, not only inside a collapsed panel or another
+ tab.
+ - The user can resume, retry, reattach to, or cancel it from there.
+ - The refusal for a busy state carries the id of what holds it (the job,
+ run, or revision), and the client uses that id to reattach or link to it.
+3. **For each client-orchestrated chain** (step A then step B; a kickoff that
+ waits for an event; a completion callback that finalizes server state):
+ - If step B throws, or the tab reloads between A and B, an exit is still
+ visible after reload.
+ - An error in the client's own follow-up code is not reported as a server
+ failure ("save failed" after the save succeeded), and is not swallowed.
+ - Every wait for an event has a timeout or a cancel, and treats an
+ interrupted or failed status as settled rather than waiting on.
+ - Progress markers that prevent a duplicate (committed, consumed ids,
+ idempotency keys) live on the server, not only in component state.
+4. **Disabled controls say why.** A control disabled because of hidden state
+ names the reason and links to where the user resolves it.
+
+When a running interface is reachable, confirm the worst candidates by driving
+the workflow: interrupt it (reload mid-step, stop the server between steps) and
+record what the page offers afterward. Otherwise trace the code on both sides
+and say that is what you did; a state with no exit is proven by reading the
+code that enters it and every path that leaves it.
+
+## Not yours
+
+Per-call timeouts and retries belong to the failure-path work; process restart
+and shutdown draining to the reliability work; duplicate writes under
+redelivery to the data-integrity work; a feature that was never finished to the
+incomplete-feature work. Name the overlap if it is the cause.
+
+## The bar
+
+Every finding names the in-progress state and where it is set (\`file:LINE\`),
+the step that can fail or be interrupted (\`file:LINE\`), the sequence that
+strands it, and what the user sees afterward. Prefer a fix in the shared
+primitive (the job-tracking hook, the refusal shape) over one workflow at a
+time when several share the cause.`,
+
'feature-ideas': `[Improvement: {appName}] Implement Next Planned Feature
Your goal is to implement the next planned item from PLAN.md, or brainstorm a new feature if no plan exists.
diff --git a/server/services/taskPromptDefaults/versions.js b/server/services/taskPromptDefaults/versions.js
index d9b54fc260..2dfb0c29f3 100644
--- a/server/services/taskPromptDefaults/versions.js
+++ b/server/services/taskPromptDefaults/versions.js
@@ -45,12 +45,12 @@ export const PROMPT_VERSIONS = {
'typing': 3, // v3: carries {modeInstructions}, exits cleanly on an untyped project, and targets boundary escape hatches and validator/type disagreement instead of a mechanical annotation sweep. Previously v2: unified `[Improvement: {appName}]` body (older default used the `[App Improvement: {appName}]` header)
'dependency-updates': 7, // v7: dependency-update worktrees keep package-manager writes out of the source checkout's shared node_modules. v6: the throwaway bot-PR worktree is `dep-{appSlug}-pr-<n>` — the app NAME alone did not isolate two managed apps sharing a name, and {appSlug} is rendered server-side rather than slugified by the agent (`appWorktreeSlug`, server/lib/worktreeOwnership.js). v5: inventory all Dependabot alerts and ecosystems, verify actual upstream fixes, and track unpatched mitigations separately from alert closure. v4: the Phase 1 GitLab MR listing gains `--output json` — without it glab answers with the human table, which carries the head branch but NOT the author, while the classification right below it reads both. The same bump drops `--state` from the MR-list recipes — that flag does not exist (MR state is selected by presence flags `--merged`/`--closed`/`--all`, and OPEN is the default), so `--state opened` exited 1 with `Unknown flag: --state` and Phase 1 skipped its bot-PR triage entirely on GitLab repos. v3: Phase 1 triages open Dependabot/Renovate PRs first (evidence → MERGE / FIX-THEN-MERGE / CLOSE / LEAVE, including conflict + CI-failure repair on the bot branch) before Phase 2 updates anything the bots didn't cover — an agent that bumped packages itself was duplicating and conflicting with open bot PRs. v2: generic {appName} body (older default hardcoded "PortOS")
'documentation': 7, // v7: carries {modeInstructions} and ranks wrong documentation above missing documentation, verifying instructions against the code rather than trusting the prose. Previously v6: the changelog step names `AGENTS.md` (or `CLAUDE.md`) as the file carrying the repo's documented convention — #4852 made AGENTS.md the canonical cross-vendor agent-instructions filename, and a managed app that adopted it would otherwise be told to read a file it no longer has. v5: the changelog step defers to the convention the repo documents (some repos collect per-branch fragments in a directory so parallel agents don't conflict) instead of prescribing an append to `.changelog/NEXT.md`. v4: generic {appName} body (v1 hardcoded "PortOS"; v2/v3 retired DONE.md wording)
- 'ui-bugs': 3, // v3: carries {modeInstructions}, exits cleanly when the interface is unreachable instead of filing from imagination, and cedes layout/a11y/UX/copy to their owners. Previously v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)
+ 'ui-bugs': 4, // v4: hunts the unhappy branch of each primary action and statically provable crashes (a call to a member the imported module lacks), which no longer count as speculative; cedes stranded workflows to workflow-recovery and unfinished controls to feature-completeness. Previous version: v3: carries {modeInstructions}, exits cleanly when the interface is unreachable instead of filing from imagination, and cedes layout/a11y/UX/copy to their owners. Previously v2: generic {appName} + the app UI (older default hardcoded "PortOS" + http://localhost:5555)
'mobile-responsive': 3, // v3: carries {modeInstructions} and requires the viewport width plus what a user cannot do there, rather than flagging any layout that merely looks different. Previously v2: generic {appName} app-UI body (older default hardcoded "PortOS" + http://localhost:5555)
- 'ux': 5, // v5: adds checklist items 9–11 (instruction text that over-explains, duplicate controls for one action, information hidden when the current state needs it) plus a per-route action/text/state inventory; previous runs only filed what items 1–8 named and treated verbosity as aesthetic. v4: forge issues use plain human-readable titles and tracker-defined IDs; filing syntax/identity comes from {trackerInstructions}. v3: audits narrow monitors and widget containers, including clipped overflow and sidebar/zoom states.
+ 'ux': 6, // v6: route selection reaches record detail/editor routes partway through their workflow with tracker-driven rotation, and adds checklist items 12 (a record page says where it stands, the next action, and how to open its output) and 13 (same page family, same shell — provable from layout config). Previous version: v5: adds checklist items 9–11 (instruction text that over-explains, duplicate controls for one action, information hidden when the current state needs it) plus a per-route action/text/state inventory; previous runs only filed what items 1–8 named and treated verbosity as aesthetic. v4: forge issues use plain human-readable titles and tracker-defined IDs; filing syntax/identity comes from {trackerInstructions}. v3: audits narrow monitors and widget containers, including clipped overflow and sidebar/zoom states.
// v2: replaces the hardcoded "Read-only on source / no branches, no PRs" paragraph with {modeInstructions} — the audit is registered as file-issues-capable, so a do-work dispatch previously got a mode banner that its own body contradicted in two places. Previously v1: walk the running UI with Playwright MCP against a 7-item named UX checklist and file ONE tracker item per finding via {trackerInstructions} — read-only on source, no branches/PRs. Mode (file-issues vs implement) is injected at dispatch via {modeInstructions} / applyAuditModeWrapper — no prompt bump required.
'data-safety': 2, // v2: generalizes beyond installs to deployments/environments/datasets and adds backup restorability, bulk/backfill safety, retention reach, and long-lived data formats; hands runtime data correctness to data-integrity. v1: data/upgrade-safety audit (migrations, schema parity, version gates). Mode injected at dispatch.
- 'simplify': 1, // v1: dead-code/duplication audit. Mode injected at dispatch.
+ 'simplify': 2, // v2: an unreferenced endpoint/setting/job that documentation, UI text or a plan describes is an unfinished feature for feature-completeness, not a deletion. Previous version: v1: dead-code/duplication audit. Mode injected at dispatch.
'module-hygiene': 1, // v1: evidence-led complexity, responsibility, reuse, and reusable-surface discoverability audit. Mode injected at dispatch.
'api-contract': 2, // v2: framework-neutral (RPC, GraphQL, event contracts, SDKs — not only Express routes) and adds spec drift, breaking changes to published contracts, idempotency keys, pagination bounds, and long synchronous work. v1: API/route-contract audit (validation gaps, client/server drift, status envelopes, asyncHandler). Net-new type (no retired-hash history needed). Mode injected at dispatch.
'ui-lifecycle': 2, // v2: framework-neutral UI lifecycle and state correctness. v1: lifecycle/state audit limited to React effects, stale closures, unmounted setState, and derived state. Mode injected at dispatch.
@@ -66,15 +66,17 @@ export const PROMPT_VERSIONS = {
'better-complexity': 2, // v2: compare repository-wide worst offenders; low churn is not an exclusion. v1: counted branching per function, ranked by churn/fan-in, with a named transformation and a behavior-preservation contract.
'better-cognitive-load': 1, // v1: reader cost (mixed abstraction, flag arguments, lying names, action at a distance) — explicitly NOT the size/nesting thresholds its siblings own.
'better-structural-drift': 1, // v1: derived artifacts as a second source of truth, position-keyed records, hand-synced registries, incidental-layout coupling — carved out of code-quality v3.
- 'better-runtime-safety': 2, // Framework-neutral UI lifecycle overlap. Previous version: v1: latent defects (floating promises, unowned rejections, unguarded access, sentinel confusion, races, leaks) requiring a concrete failure scenario.
+ 'better-runtime-safety': 3, // v3: adds cross-module contract breaks in untyped code (missing members, missing named exports, dropped wrapper arguments) with a guard-test fix. Previous version: Framework-neutral UI lifecycle overlap. Previous version: v1: latent defects (floating promises, unowned rejections, unguarded access, sentinel confusion, races, leaks) requiring a concrete failure scenario.
'better-dependency-freedom': 1, // v1: dependency NECESSITY (the do:depfree lens) — classify, prove usage, size the replacement. Distinct from dependency-updates, which bumps what stays.
'infrastructure': 1, // v1: IaC/container/orchestration/CI audit — exposure, identity grants, secrets, pinning, runtime guardrails, state config, CI supply chain, environment drift. Net-new type. Mode injected at dispatch.
'data-integrity': 1, // v1: runtime data-correctness audit — idempotency under redelivery, partial writes, lost updates, boundary validation, schema evolution, semantic corruption, pagination, retention, transfer checks. Net-new type.
'reliability': 1, // v1: service reliability audit — shutdown draining, truthful health checks, backpressure, job leasing/checkpoints, startup fragility, mixed-version deploys. Net-new type.
'privacy': 1, // v1: personal/sensitive-data audit — operational exposure, third-party minimization, API over-exposure, retention, erasure reach, real data in fixtures. Honors the project's documented sharing model. Net-new type.
'cost-efficiency': 1, // v1: metered-spend audit — repeated paid calls, unrequested provider work, retry multiplication, unbounded scans, storage growth, over-provisioning, egress. Net-new type.
+ 'feature-completeness': 1, // v1: incomplete-feature audit — stubs and 501s reachable from the UI, permanently disabled or "coming soon" controls, UI/doc promises the code does not keep, settings nothing reads, capabilities with no entry point, events nobody hears, plans that disagree with the code, deferred work with no live tracker item. Decides finish / hide / remove. Net-new type.
+ 'workflow-recovery': 1, // v1: workflow completion and recovery audit — inventories server in-progress states and checks each has a visible resume/cancel/reattach exit, busy refusals carry the holder id, client-orchestrated chains survive a failed follow-up step or reload, waits time out, and duplicate-preventing markers live on the server. Net-new type.
'better-dev-environment': 1, // v1: host impact of the development loop, measured by diffing host state around a bounded run — leaked temp files/processes/ports, writes outside the sandbox, accumulation, watcher/idle cost, suite runtime. Net-new type.
- 'better-test-quality': 1, // v1: vacuous/weak/redundant existing tests, proven with a mutation probe. Distinct from test-coverage, which owns the gaps.
+ 'better-test-quality': 2, // v2: adds mocks that drift from the module they replace (members/exports the real module lacks). Previous version: v1: vacuous/weak/redundant existing tests, proven with a mutation probe. Distinct from test-coverage, which owns the gaps.
'stash-cleanup': 2, // v2: the STALE/ABANDONED heuristic names `AGENTS.md` (or `CLAUDE.md`) as the policy file to check before assuming a stash contradicts current architecture (#4852). v1: triage git stash list — supersession check against main, drop superseded/stale entries, leave real unlanded work in place. Net-new type (no retired-hash history needed).
'repo-sync': 1, // v1: verify + finish the deterministic install-wide origin-sync sweep (services/repoSync.js) — resolve mid-flight merges/rebases, decide what to do with uncommitted work, land or report unpushed branches, triage the stashes it could not prove redundant. Net-new type (no retired-hash history needed).
'do-release': 15, // v15: renamed from `release-check` — the goal is a SHIPPED release, not a readiness check. The run first finishes in-flight work no live agent owns (open PRs, lingering branches via branch-reconcile), merges dependency-bot PRs, then releases; a blocker that survives three attempts goes to a sub-agent or a queued PortOS task instead of ending the run (v14 stopped at its 10-commit bound with the release PR open), local-only flakes no longer block a green-CI release, and routine design/preference decisions are made and listed for operator review. The operator's `{releaseOptions}` toggles (finishInFlight / mergeDependencyUpdates / resolveBlockers / autoDecide) gate each step. v14: the release agent names each release from its one or two biggest user-visible wins and writes the exact first heading the GitHub workflow promotes to the release title. v13: a failing test suite or red CI is work the run must FIX (reproduce, classify regression vs. bad test vs. environmental blocker, fix the root cause, verify, commit, resume) instead of a reason to halt the release — a pre-existing failure on main stopped v12 short with the release untouched; skipping/deleting/loosening a test to force green is explicitly not a fix, and the loop is bounded (3 attempts per failure, 10 fix commits per run). v12: code review is advisory and only CI gates release progress; v11: delegate release mechanics to bundled slashdo release and pin PortOS-configured reviewers. v10: the release-documentation search names the `AGENTS.md` (or `CLAUDE.md`) context instead of CLAUDE.md alone (#4852). v9: Step 1 reconciles missing GitHub Releases against git release tags (publishing any missing tag with .changelog/vX.Y.Z.md as body and --latest=false when a newer version exists) BEFORE evaluating if enough unreleased work has accumulated; v8: database-backed release tests are provisioned and run using the repo's documented isolated test database before the release PR gate; v7: Step 1 also reads the UNCOLLECTED changelog fragments (the fragment dir, plus whatever preview command that repo documents — release-check is a generic {appName} prompt, so it never names a PortOS script to run) and counts substantive entries across the assembled notes — reading only the staged `.changelog/NEXT.md` under-counts a release whose entries are still per-branch fragments, so a ready release reported as "not enough work". v6: generic {appName} body (older defaults hardcoded "PortOS")
diff --git a/server/services/taskScheduleRegistry.js b/server/services/taskScheduleRegistry.js
index 9cfb0016bb..8b7005329b 100644
--- a/server/services/taskScheduleRegistry.js
+++ b/server/services/taskScheduleRegistry.js
@@ -379,6 +379,10 @@ const TASK_INTERVAL_DEFAULTS = {
'reliability': fileIssuesAuditInterval(),
'privacy': fileIssuesAuditInterval(),
'cost-efficiency': fileIssuesAuditInterval(),
+ // Gap lenses the page-walking audits miss: unfinished features and workflows
+ // that strand their record between steps. File-issues by default.
+ 'feature-completeness': fileIssuesAuditInterval(),
+ 'workflow-recovery': fileIssuesAuditInterval(),
// Trusted remediation is separate from external intake. Legacy author
// filter settings cannot widen this lane into untrusted contributor PRs.
'pr-watcher': { type: INTERVAL_TYPES.ON_DEMAND, intervalMs: 1800000, enabled: true, providerId: null, model: null, prompt: null, taskMetadata: { prAuthorFilter: 'trusted', readOnly: false } },
@@ -609,6 +613,8 @@ export const TASK_TYPE_DESCRIPTIONS = {
'reliability': 'Reliability — graceful shutdown, health/readiness, backpressure, job leasing, mixed-version deploys; file issues (default) or implement fixes',
'privacy': 'Privacy & data governance — personal data in logs/exports/third parties, minimization, retention and erasure; file issues (default) or implement fixes',
'cost-efficiency': 'Cost efficiency — metered API/model calls, unbounded scans, storage tiers, over-provisioning; file issues (default) or implement fixes',
+ 'feature-completeness': 'Feature completeness — stubs reachable from the UI, disabled or "coming soon" controls, settings nothing reads, endpoints with no entry point; file issues (default) or finish one',
+ 'workflow-recovery': 'Workflow recovery — in-progress states with no visible resume/cancel, busy refusals without a handle, follow-up steps that strand a record; file issues (default) or implement fixes',
'model-comparison-refresh': 'Research sourced model quality, effort, price, latency and quota evidence for Models Comparison',
'stash-cleanup': 'Triage git stash list — drop entries superseded by or stale relative to main, leave real unlanded work in place',
'repo-sync': 'Sync every managed app with origin — back on the default branch, pushed and pulled, merged branches/worktrees and redundant stashes cleared',