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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
feat: split code review setup from follow-up and title Models pages by destination
[._.]/ Adam Eivy554cc52ec0f4
diff --git a/client/src/components/cos/ReviewerGroupsEditor.jsx b/client/src/components/cos/ReviewerGroupsEditor.jsxindex 0e63e89deb..2ef68f800e 100644--- a/client/src/components/cos/ReviewerGroupsEditor.jsx+++ b/client/src/components/cos/ReviewerGroupsEditor.jsx@@ -145,8 +145,6 @@ export default function ReviewerGroupsEditor({ groups, onGroupsChange, reviewerHreturn (<div className="space-y-3 min-w-0">- <p className="text-xs text-gray-400">The first tier with every member unpaused is selected. Even one paused member skips that tier. If all tiers contain a paused member, the first configured tier is selected; its paused reviewers still report unavailable. Empty tiers are drafts and disappear on save. Status previews this draft; changes apply when saved.</p>- <p className="text-xs text-gray-500">Drag a handle with a pointer or touch, or press Space, use arrow keys, then Space to drop (Escape cancels). Move controls also work without dragging. Tool-free reviewers always run first within each tier; pins are shared wherever the same identity appears.</p><DndContext sensors={sensors} collisionDetection={collisionDetection} onDragEnd={drop}accessibility={{screenReaderInstructions: { draggable: 'Press Space to pick up. Use arrow keys to move between reviewers or tiers. Press Space to drop, or Escape to cancel. Tool-free reviewers always run first.' },@@ -177,7 +175,7 @@ export default function ReviewerGroupsEditor({ groups, onGroupsChange, reviewerHonChange(pruneRemoved(next));}}>Remove tier</button></div>- <ReviewerPicker {...pickerProps} reviewers={group.reviewers} onChange={value => updateTier(group, value)} disabled={disabled} showUsernames={false} showRunFlags={false}+ <ReviewerPicker {...pickerProps} reviewers={group.reviewers} onChange={value => updateTier(group, value)} disabled={disabled} showUsernames={false} showRunFlags={false} showIntro={false}renderReviewer={(token, row) => <DraggableReviewItem key={token} id={memberId(group.id, token)}data={{ kind: 'member', groupId: group.id, token, label: `${token} in ${name}` }} disabled={disabled} handles={handles}>{memberHandle => <div className="min-w-0 border-t border-port-border/50 py-1">@@ -200,10 +198,13 @@ export default function ReviewerGroupsEditor({ groups, onGroupsChange, reviewerH</div></DndContext>{!allReviewers.length && <p className="text-xs text-gray-400">AI review is disabled. Forge reviewers below are preserved.</p>}- <button type="button" disabled={disabled} className="min-h-11 px-3 text-sm text-port-accent border border-port-border rounded disabled:opacity-40"- onClick={() => changeGroups([...groups, { id: `${id}-tier-${serial.current++}`, reviewers: [] }], 'Empty tier added.')}>Add tier</button>+ <div className="flex flex-wrap items-center gap-3">+ <button type="button" disabled={disabled} className="min-h-11 px-3 text-sm text-port-accent border border-port-border rounded disabled:opacity-40"+ onClick={() => changeGroups([...groups, { id: `${id}-tier-${serial.current++}`, reviewers: [] }], 'Empty tier added.')}>Add tier</button>+ <p className="text-xs text-gray-500">Empty tiers are drafts and are dropped when you save.</p>+ </div><p role="status" className="text-xs text-gray-400">{announcement}</p>- <ReviewerPicker {...pickerProps} reviewers={allReviewers} onChange={onChange} disabled={disabled} showReviewers={false} />+ <ReviewerPicker {...pickerProps} reviewers={allReviewers} onChange={onChange} disabled={disabled} showReviewers={false} showIntro={false} /></div>);}diff --git a/client/src/components/cos/ReviewerPicker.jsx b/client/src/components/cos/ReviewerPicker.jsxindex 9c0eae7ddf..40a6d61fe6 100644--- a/client/src/components/cos/ReviewerPicker.jsx+++ b/client/src/components/cos/ReviewerPicker.jsx@@ -171,6 +171,9 @@ export default function ReviewerPicker({showRunFlags = true,showReviewers = true,showUsernames = true,+ // Page-level help (Code Reviewers) explains tiers once. Compact callers such+ // as a task form still get the short intro beside the controls.+ showIntro = true,renderReviewer = (_token, row) => row,}) {const id = useId();@@ -754,14 +757,18 @@ export default function ReviewerPicker({<button type="button" disabled={disabled || !addProviderId || selected.includes(`provider:${addProviderId}`)}className="min-h-9 text-sm text-port-accent disabled:opacity-50"onClick={() => { add(`provider:${addProviderId}`); setAddProviderId(''); }}>Add provider reviewer</button>- <p className="text-xs text-gray-500">Add a configured provider, then choose its model and effort on its row. Its account and transport stay attached to that identity.</p>+ {showIntro && <p className="text-xs text-gray-500">Add a configured provider, then choose its model and effort on its row. Its account and transport stay attached to that identity.</p>}{modelOptions?.providersLoaded === false && modelOptions?.loaded && <p role="alert" className="text-xs text-port-warning">Provider list unavailable. Reload this page to retry; saved reviewers and pins are preserved.</p>}</div>)}{effortNotice && <p role="status" className="text-xs text-port-warning">{effortNotice}</p>}{showReviewers && <div className="flex flex-col gap-1">- <span className="text-xs text-gray-500">Reviewers (in order):</span>- <p className="text-xs text-gray-400">Tool-free first, then standalone CLI / Copilot.</p>+ {showIntro && (+ <>+ <span className="text-xs text-gray-500">Reviewers (in order):</span>+ <p className="text-xs text-gray-400">Tool-free first, then standalone CLI / Copilot.</p>+ </>+ )}{selected.length > 0 && (<><div className={HEADER_CLASS} aria-hidden="true">@@ -839,7 +846,7 @@ export default function ReviewerPicker({)}</div>}- {showUsernames && (selected.length > 0 || selectedUsernames.length > 0) && (+ {showIntro && showUsernames && (selected.length > 0 || selectedUsernames.length > 0) && (<details className="text-[11px] text-gray-400"><summary className="cursor-pointer text-xs text-gray-500 hover:text-gray-300">Tip: reviewer controls</summary><p className="mt-1">@@ -851,7 +858,7 @@ export default function ReviewerPicker({{showReviewers && addable.length > 0 && (<details className="text-xs text-gray-500"><summary className="cursor-pointer min-h-9">Standalone / legacy backend</summary>- <p className="mb-2">Direct CLI, local runtime and Copilot identities keep their existing behavior. Prefer a configured provider to select an account and transport.</p>+ {showIntro && <p className="mb-2">Direct CLI, local runtime and Copilot identities keep their existing behavior. Prefer a configured provider to select an account and transport.</p>}<div className="flex flex-wrap items-end gap-2"><div className="min-w-0 flex-1 max-w-xs"><label htmlFor={`${id}-legacy`} className="block mb-1">Legacy backend</label>diff --git a/client/src/components/cos/ReviewerPicker.test.jsx b/client/src/components/cos/ReviewerPicker.test.jsxindex 2c8be7ee48..90895f1afb 100644--- a/client/src/components/cos/ReviewerPicker.test.jsx+++ b/client/src/components/cos/ReviewerPicker.test.jsx@@ -233,6 +233,15 @@ describe('ReviewerPicker', () => {expect(screen.getByText(/none — no AI reviewers in this list/)).toBeInTheDocument();});+ it('keeps the short provider intro unless the page explains tiers itself', () => {+ const { unmount } = render(<ReviewerPicker reviewers={[]} onChange={() => {}} />);+ expect(screen.getByText(/Add a configured provider/)).toBeInTheDocument();+ unmount();+ render(<ReviewerPicker reviewers={['codex']} onChange={() => {}} showIntro={false} />);+ expect(screen.queryByText(/Add a configured provider/)).not.toBeInTheDocument();+ expect(screen.queryByText(/Tool-free first/)).not.toBeInTheDocument();+ });+it('de-dupes a malformed list with duplicates (order-preserving)', () => {render(<ReviewerPicker reviewers={['codex', 'codex', 'antigravity']} onChange={() => {}} />);// Two distinct pills (badges 1 and 2), not three.diff --git a/client/src/components/settings/CodeReviewHelp.jsx b/client/src/components/settings/CodeReviewHelp.jsxnew file mode 100644index 0000000000..4cadd0c25b--- /dev/null+++ b/client/src/components/settings/CodeReviewHelp.jsx@@ -0,0 +1,52 @@+// The once-per-page explanation for Code Reviewers. Tier cards used to repeat+// this beside every fallback, and the page opened with the same paragraphs+// again. Consequences that belong next to a control stay on the page; this+// drawer is the reference for how the chain behaves.++function Section({ title, children }) {+ return (+ <section className="space-y-1">+ <h3 className="text-sm font-semibold text-white">{title}</h3>+ <div className="space-y-2 text-sm text-gray-400 leading-relaxed">{children}</div>+ </section>+ );+}++export default function CodeReviewHelp() {+ return (+ <div className="space-y-5">+ <Section title="Which tier runs">+ <p>Primary is tried first. The first tier whose reviewers are all available runs. One paused member skips that whole tier.</p>+ <p>If every tier has a paused member, Primary still runs and those reviewers report unavailable. Status on the tier is a preview of this draft. It changes when you save.</p>+ <p>Clearing every tier turns AI review off. Forge reviewers in the section below the tiers stay in place.</p>+ </Section>+ <Section title="Order inside a tier">+ <p>Tool-free reviewers run before standalone CLI and Copilot reviewers. A move that would put a CLI reviewer ahead of a tool-free one is put back into that order.</p>+ <p>Model, effort, optional, and max-round pins belong to the reviewer, not the tier. The same reviewer in two tiers shares one pin.</p>+ </Section>+ <Section title="Moving tiers and reviewers">+ <p>Drag a handle with a pointer or touch. From the keyboard, press Space on a handle, move with the arrow keys, then Space to drop. Escape cancels.</p>+ <p>Earlier and Later move a whole tier. Move to tier moves one reviewer without dragging.</p>+ </Section>+ <Section title="Providers and legacy backends">+ <p>Add a configured provider, then set its model and effort on the row. The account and transport stay attached to that provider. Choose Custom… on the model menu to type an id that is not in the catalog.</p>+ <p>Standalone / legacy backend is the direct CLI, local runtime, and Copilot list. Those identities do not pick a provider account.</p>+ </Section>+ <Section title="Row controls">+ <p>Optional (~opt) still runs the reviewer, but an inconclusive result does not block the merge. A hard failure still does.</p>+ <p>Max caps review, fix, and re-review rounds. Blank uses the reviewer’s built-in cap. 0 means loop until clean.</p>+ <p>Stop mode, under the tiers, decides whether every reviewer must finish or the loop can stop earlier. It applies when two or more reviewers are configured.</p>+ </Section>+ <Section title="Forge reviewers">+ <p>GitHub and GitLab usernames gate the merge and are not members of a tier. Separate names with commas or newlines. Enter adds the list. An invalid name or a full roster leaves the draft so you can correct it.</p>+ </Section>+ <Section title="Follow-up">+ <p>Follow-up is a second check after a run ships. It compares the accumulated diff with the task objective: what is missing, what was never requested, and whether the work was verified. It is not the code-quality review.</p>+ <p>It runs on a local model, either the one you pick or whichever local reviewer the chain already uses. Leaving it on does nothing until a local model is available.</p>+ <p>A rethink verdict means the run built the wrong thing and the run needs attention. Fix-first is advisory. Act on which verdicts chooses whether follow-up actions also fire for that advisory result.</p>+ <p>File an issue writes the finding to the tracker the project uses (GitHub, GitLab, or JIRA). A key in the issue body reuses the existing issue for that finding, including after it was closed. A tracker PortOS cannot read refuses the filing instead of risking a duplicate.</p>+ <p>Queue an agent adds a CoS task that claims the issue, or works the finding directly when no issue was filed. The agent checks the finding first. When the objective was already delivered, it reports the context the reviewer missed instead of shipping a change. Repeated findings share one queued task.</p>+ </Section>+ </div>+ );+}diff --git a/client/src/components/settings/CodeReviewersTab.jsx b/client/src/components/settings/CodeReviewersTab.jsxindex ad25217e29..2301ed67c4 100644--- a/client/src/components/settings/CodeReviewersTab.jsx+++ b/client/src/components/settings/CodeReviewersTab.jsx@@ -1,10 +1,14 @@import { useCallback, useEffect, useRef, useState } from 'react';-import { ShieldCheck } from 'lucide-react';+import { useLocation, useNavigate, useSearchParams } from 'react-router';+import { CircleHelp, ListTree, ScanSearch } from 'lucide-react';import toast from '../ui/Toast';import Banner from '../ui/Banner';+import Drawer from '../Drawer';+import TabPills from '../ui/TabPills';import * as api from '../../services/api';import ReviewerGroupsEditor from '../cos/ReviewerGroupsEditor';import GoalFidelityControls from './GoalFidelityControls';+import CodeReviewHelp from './CodeReviewHelp';import useReviewerModelOptions from '../../hooks/useReviewerModelOptions';import { reviewerModelsFromDefaults, reviewerModelsToDefaults, reviewerEffortsFromDefaults, reviewerEffortsToDefaults } from '../../lib/reviewerModels';import { DEFAULT_GOAL_FIDELITY_FOLLOW_UP_TRIGGER } from '../../lib/reviewerPins';@@ -13,13 +17,39 @@ import {} from '../cos/constants';// Global Code Review Defaults — the chain the Review Loop uses when a task or-// task-type config didn't pin its own reviewers. Owns the Settings › Code-// Reviewers tab (it used to sit at the top of the AI Providers page, where it-// buried the provider list under a table most visits didn't need). Every-// per-reviewer control (model, `~opt`, `~max`) lives in the shared-// ReviewerPicker table (#3133), so this tab owns only the fetch of the model-// option lists (via useReviewerModelOptions) and the save.-export default function CodeReviewersTab() {+// task-type config didn't pin its own reviewers. Owns Models → Code Reviewers.+// Every per-reviewer control (model, `~opt`, `~max`) lives in the shared+// ReviewerPicker table (#3133), so this tab owns the fetch of the model option+// lists (via useReviewerModelOptions), the save, and which task view is open.+//+// Review chain and Follow-up are route-backed task views. The help drawer holds+// the tier rules once; the cards themselves stay the controls.++const REVIEW_VIEWS = [+ { id: 'chain', label: 'Review chain', icon: ListTree },+ { id: 'follow-up', label: 'Follow-up', icon: ScanSearch },+];+const CHAIN_PATH = '/models/code-reviewers';+const FOLLOW_UP_PATH = '/models/code-reviewers/follow-up';++// `null` when the URL is not this page (unit tests render the panel alone).+// A slug under the page that is not a known view is returned so the caller can+// replace it with the chain.+function viewFromPath(pathname) {+ const path = String(pathname || '').replace(/\/+$/, '');+ if (path === CHAIN_PATH) return 'chain';+ if (!path.startsWith(`${CHAIN_PATH}/`)) return null;+ return path.slice(CHAIN_PATH.length + 1).split('/')[0] || 'chain';+}++export default function CodeReviewersTab({ view } = {}) {+ const location = useLocation();+ const navigate = useNavigate();+ const [searchParams, setSearchParams] = useSearchParams();+ const pathView = viewFromPath(location.pathname);+ const requested = pathView ?? (view === 'follow-up' ? 'follow-up' : 'chain');+ const activeView = requested === 'follow-up' ? 'follow-up' : 'chain';+ const helpOpen = searchParams.get('help') === '1';const [loading, setLoading] = useState(true);const [loadError, setLoadError] = useState(false);const [saving, setSaving] = useState(false);@@ -101,6 +131,24 @@ export default function CodeReviewersTab() {return () => { loadVersion.current += 1; };}, [loadDefaults]);+ useEffect(() => {+ if (pathView && pathView !== 'chain' && pathView !== 'follow-up') {+ navigate({ pathname: CHAIN_PATH, search: location.search }, { replace: true });+ }+ }, [location.search, navigate, pathView]);++ const openView = (next) => {+ navigate({ pathname: next === 'follow-up' ? FOLLOW_UP_PATH : CHAIN_PATH, search: location.search });+ };+ const setHelp = (open) => {+ setSearchParams((prev) => {+ const next = new URLSearchParams(prev);+ if (open) next.set('help', '1');+ else next.delete('help');+ return next;+ }, { replace: true });+ };+const handleSave = async () => {if (saveInFlight.current || loading || loadError) return;saveInFlight.current = true;@@ -147,13 +195,41 @@ export default function CodeReviewersTab() {};return (- <div className="bg-port-card border border-port-border rounded-xl p-4 space-y-3">- <div className="flex items-center gap-2">- <ShieldCheck size={16} className="text-port-accent" />- <h2 className="text-base font-semibold text-white">Code Review Defaults</h2>+ <div className="space-y-4 min-w-0">+ <div className="flex flex-wrap items-center justify-between gap-3">+ <TabPills+ tabs={REVIEW_VIEWS}+ activeTab={activeView}+ onChange={openView}+ ariaLabel="Code review tasks"+ controlsIdPrefix="code-review-task"+ mobileCompact+ />+ <div className="flex flex-wrap items-center gap-2">+ <button+ type="button"+ onClick={() => setHelp(true)}+ className="inline-flex min-h-11 items-center gap-1.5 px-3 text-sm text-gray-300 border border-port-border rounded hover:text-white hover:border-port-accent"+ >+ <CircleHelp size={16} aria-hidden="true" />+ How this works+ </button>+ {!loading && (+ <button+ type="button"+ onClick={handleSave}+ disabled={saving || loadError}+ className="min-h-11 px-3 text-sm bg-port-accent hover:bg-port-accent/80 disabled:opacity-50 text-white rounded transition-colors"+ >+ {saving ? 'Saving…' : 'Save defaults'}+ </button>+ )}+ </div></div>- <p className="text-xs text-gray-500">- Choose Primary and fallback tiers for CoS tasks and schedules without their own override. Clearing all tiers disables AI reviewers while preserving forge reviewers. Provider reviews retain the selected provider's configuration. Choose <span className="font-mono">Custom…</span> on a reviewer row to enter a model absent from its catalog.+ <p className="text-sm text-gray-400">+ {activeView === 'follow-up'+ ? 'After a run ships, compare its diff with the task it was given.'+ : 'Primary runs first. One paused reviewer skips that whole tier. Tasks with their own reviewers keep that override.'}</p>{loadError && (@@ -182,7 +258,7 @@ export default function CodeReviewersTab() {{Object.entries(reviewerConfigFaults).map(([reviewer, fault]) => (<Banner key={`config-${reviewer}`} tone="warning" size="sm" align="left">{reviewer} cannot review on this install ({fault.code}). The review loop is currently a no-op for this reviewer. {fault.code === 'NO_MODEL'- ? 'Select a model in this tab.'+ ? 'Select a model on Review chain.': fault.code === 'REVIEWER_ACCESS_DENIED'? 'Select an accessible service or model, or correct provider access. A successful review clears this warning.': fault.code === 'REVIEWER_UNSUPPORTED'@@ -190,51 +266,55 @@ export default function CodeReviewersTab() {: 'Enable or configure the reviewer in Settings → Code Reviewers.'}</Banner>))}- <ReviewerGroupsEditor- groups={reviewerFallbackGroups}- onGroupsChange={setReviewerFallbackGroups}- reviewerHealth={reviewerHealth}- usernames={usernames}- optionalReviewers={optionalReviewers}- reviewerMaxRounds={reviewerMaxRounds}- reviewerModels={reviewerModels}- reviewerEfforts={reviewerEfforts}- modelOptions={modelOptions}- installed={installed}- providerReviewUnsupported={providerReviewUnsupported}- stopMode={stopMode}- reviewerApplies={reviewerApplies}- disabled={saving || loadError}- onChange={({ usernames: u, optionalReviewers: o, reviewerMaxRounds: m, reviewerModels: dm, reviewerEfforts: de, stopMode: s, reviewerApplies: a }) => {- setUsernames(u);- setOptionalReviewers(o);- setReviewerMaxRounds(m);- setReviewerModels(dm);- setReviewerEfforts(de);- setStopMode(s);- setReviewerApplies(a);- }}- />-- <GoalFidelityControls- value={goalFidelity}- modelOptions={modelOptions}- disabled={saving || loadError}- onChange={setGoalFidelity}- />-- <div className="flex justify-end">- <button- type="button"- onClick={handleSave}- disabled={saving || loadError}- className="px-3 py-1.5 text-sm bg-port-accent hover:bg-port-accent/80 disabled:opacity-50 text-white rounded transition-colors"- >- {saving ? 'Saving…' : 'Save defaults'}- </button>- </div>+ {activeView === 'chain' ? (+ <div role="tabpanel" id="code-review-task-chain" aria-labelledby="tab-chain">+ <ReviewerGroupsEditor+ groups={reviewerFallbackGroups}+ onGroupsChange={setReviewerFallbackGroups}+ reviewerHealth={reviewerHealth}+ usernames={usernames}+ optionalReviewers={optionalReviewers}+ reviewerMaxRounds={reviewerMaxRounds}+ reviewerModels={reviewerModels}+ reviewerEfforts={reviewerEfforts}+ modelOptions={modelOptions}+ installed={installed}+ providerReviewUnsupported={providerReviewUnsupported}+ stopMode={stopMode}+ reviewerApplies={reviewerApplies}+ disabled={saving || loadError}+ onChange={({ usernames: u, optionalReviewers: o, reviewerMaxRounds: m, reviewerModels: dm, reviewerEfforts: de, stopMode: s, reviewerApplies: a }) => {+ setUsernames(u);+ setOptionalReviewers(o);+ setReviewerMaxRounds(m);+ setReviewerModels(dm);+ setReviewerEfforts(de);+ setStopMode(s);+ setReviewerApplies(a);+ }}+ />+ </div>+ ) : (+ <div role="tabpanel" id="code-review-task-follow-up" aria-labelledby="tab-follow-up" className="bg-port-card border border-port-border rounded-xl p-4">+ <GoalFidelityControls+ value={goalFidelity}+ modelOptions={modelOptions}+ disabled={saving || loadError}+ onChange={setGoalFidelity}+ />+ </div>+ )}</>)}+ <Drawer+ open={helpOpen}+ onClose={() => setHelp(false)}+ title="How code review works"+ closeLabel="Close how code review works"+ size="md"+ >+ <CodeReviewHelp />+ </Drawer></div>);}diff --git a/client/src/components/settings/CodeReviewersTab.test.jsx b/client/src/components/settings/CodeReviewersTab.test.jsxindex 0714e13995..8027309fdc 100644--- a/client/src/components/settings/CodeReviewersTab.test.jsx+++ b/client/src/components/settings/CodeReviewersTab.test.jsx@@ -1,5 +1,6 @@import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';import { render, screen, fireEvent, cleanup, waitFor, within } from '@testing-library/react';+import { MemoryRouter } from 'react-router';import CodeReviewersTab from './CodeReviewersTab';import * as api from '../../services/api';import toast from '../ui/Toast';@@ -19,6 +20,14 @@ vi.mock('../ui/Toast', () => ({},}));+const renderTab = (ui, path = '/') => render(+ <MemoryRouter initialEntries={[path]}>{ui}</MemoryRouter>,+);++const openFollowUp = async () => {+ fireEvent.click(await screen.findByRole('tab', { name: 'Follow-up' }));+};+describe('CodeReviewersTab', () => {beforeEach(() => {vi.clearAllMocks();@@ -41,7 +50,7 @@ describe('CodeReviewersTab', () => {};api.getCodeReviewDefaults.mockResolvedValue({ reviewers: ['copilot'], codexModel: 'legacy-model', claudeEffort: 'medium' });api.updateSettings.mockResolvedValue({});- const view = render(<CodeReviewersTab />);+ const view = renderTab(<CodeReviewersTab />);const provider = await screen.findByLabelText('Provider');expect(screen.queryByRole('option', { name: 'Disabled API' })).not.toBeInTheDocument();fireEvent.change(provider, { target: { value: 'example-gpu' } });@@ -59,7 +68,7 @@ describe('CodeReviewersTab', () => {});view.unmount();api.getCodeReviewDefaults.mockResolvedValue(saved);- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(await screen.findByLabelText('Model for Example GPU')).toHaveValue('coder-b');expect(screen.getByLabelText('Reasoning effort for Example GPU')).toHaveValue('high');fireEvent.change(screen.getByLabelText('Reasoning effort for Example GPU'), { target: { value: '' } });@@ -90,7 +99,7 @@ describe('CodeReviewersTab', () => {usernames: ['example-bot'], stopMode: 'consensus', reviewerApplies: true,});api.updateSettings.mockResolvedValue({});- const view = render(<CodeReviewersTab />);+ const view = renderTab(<CodeReviewersTab />);const primary = await screen.findByRole('region', { name: 'Primary' });expect(within(primary).getByLabelText('Model for Example GPU')).toHaveValue('custom-coder');expect(api.updateSettings).not.toHaveBeenCalled();@@ -120,7 +129,7 @@ describe('CodeReviewersTab', () => {expect(screen.queryByRole('region', { name: 'Fallback 2' })).not.toBeInTheDocument();view.unmount();api.getCodeReviewDefaults.mockResolvedValue(saved);- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);fireEvent.click(await screen.findByText('Save defaults'));await waitFor(() => expect(api.updateSettings).toHaveBeenCalledTimes(2));expect(api.updateSettings.mock.lastCall[0].codeReview).toEqual(saved);@@ -140,7 +149,7 @@ describe('CodeReviewersTab', () => {api.getCodeReviewDefaults.mockResolvedValue({ reviewers: ['codex'], reviewerFallbackGroups: [], usernames: ['example-bot'] });let rejectSave;api.updateSettings.mockImplementationOnce(() => new Promise((_, reject) => { rejectSave = reject; }));- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);fireEvent.click(await screen.findByText('Save defaults'));expect(screen.getByText('Saving…')).toBeDisabled();expect(screen.getByText('Add tier')).toBeDisabled();@@ -157,7 +166,7 @@ describe('CodeReviewersTab', () => {it('does not enable save after a malformed defaults response', async () => {api.getCodeReviewDefaults.mockResolvedValue({ reviewers: ['codex'], reviewerFallbackGroups: [['codex'], null] });- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(await screen.findByText('Failed to load code review defaults.')).toBeInTheDocument();expect(screen.getByText('Save defaults')).toBeDisabled();expect(api.updateSettings).not.toHaveBeenCalled();@@ -173,7 +182,7 @@ describe('CodeReviewersTab', () => {reviewerApplies: false,});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(screen.getByText('Loading defaults…')).toBeInTheDocument();@@ -189,11 +198,11 @@ describe('CodeReviewersTab', () => {reviewerConfigFaults: { ollama: { code: 'NO_MODEL', lastFailureAt: 123 } },});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(await screen.findByText(/ollama cannot review on this install \(NO_MODEL\)/)).toBeInTheDocument();expect(screen.getByText(/review loop is currently a no-op for this reviewer/)).toBeInTheDocument();- expect(screen.getByText(/Select a model in this tab/)).toBeInTheDocument();+ expect(screen.getByText(/Select a model on Review chain/)).toBeInTheDocument();});it('identifies a provider access refusal and its configuration remedy', async () => {@@ -202,7 +211,7 @@ describe('CodeReviewersTab', () => {optionalReviewers: ['opencode'],reviewerConfigFaults: { opencode: { code: 'REVIEWER_ACCESS_DENIED', lastFailureAt: 123 } },});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(await screen.findByText(/opencode cannot review on this install/)).toHaveTextContent('Select an accessible service or model, or correct provider access.');expect(screen.getByText(/A successful review clears this warning/)).toBeInTheDocument();});@@ -210,7 +219,7 @@ describe('CodeReviewersTab', () => {it('renders error banner with Retry button and disables Save button when fetch rejects', async () => {api.getCodeReviewDefaults.mockRejectedValue(new Error('Network error'));- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(await screen.findByText('Failed to load code review defaults.')).toBeInTheDocument();const retryBtn = screen.getByRole('button', { name: 'Retry' });@@ -232,7 +241,7 @@ describe('CodeReviewersTab', () => {reviewerApplies: false,});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);expect(await screen.findByText('Failed to load code review defaults.')).toBeInTheDocument();expect(screen.getByRole('button', { name: 'Save defaults' })).toBeDisabled();@@ -259,7 +268,7 @@ describe('CodeReviewersTab', () => {});api.updateSettings.mockResolvedValue({ success: true });- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);const saveBtn = await screen.findByRole('button', { name: 'Save defaults' });fireEvent.click(saveBtn);@@ -282,7 +291,8 @@ describe('CodeReviewersTab', () => {});api.updateSettings.mockResolvedValue({});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);+ await openFollowUp();const checkbox = await screen.findByLabelText(/Check finished runs against the task objective/);// An install that has never saved the block must read as ON — persisting a// stored `false` here would silently switch off a gate nobody turned off.@@ -315,7 +325,8 @@ describe('CodeReviewersTab', () => {});api.updateSettings.mockResolvedValue({});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);+ await openFollowUp();fireEvent.click(await screen.findByLabelText(/Check finished runs against the task objective/));fireEvent.click(screen.getByRole('button', { name: 'Save defaults' }));@@ -338,7 +349,8 @@ describe('CodeReviewersTab', () => {});api.updateSettings.mockResolvedValue({});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);+ await openFollowUp();expect(await screen.findByLabelText(/File an issue on the project/)).toBeChecked();expect(screen.getByLabelText(/Queue an agent to reconcile it/)).not.toBeChecked();expect(screen.getByLabelText('Act on which verdicts')).toHaveValue('any-finding');@@ -365,7 +377,8 @@ describe('CodeReviewersTab', () => {goalFidelity: { enabled: true },});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);+ await openFollowUp();expect(await screen.findByLabelText(/File an issue on the project/)).not.toBeChecked();expect(screen.getByLabelText(/Queue an agent to reconcile it/)).not.toBeChecked();// The trigger is meaningless until an action is armed.@@ -385,8 +398,43 @@ describe('CodeReviewersTab', () => {goalFidelity: { enabled: false, fileIssue: true },});- render(<CodeReviewersTab />);+ renderTab(<CodeReviewersTab />);+ await openFollowUp();expect(await screen.findByLabelText(/File an issue on the project/)).toBeDisabled();expect(screen.getByLabelText(/Queue an agent to reconcile it/)).toBeDisabled();});++ it('keeps tier instructions in one drawer and splits follow-up onto its own view', async () => {+ api.getCodeReviewDefaults.mockResolvedValue({+ reviewers: ['codex'],+ reviewerFallbackGroups: [['codex'], ['ollama']],+ });+ renderTab(<CodeReviewersTab />);+ expect(await screen.findByRole('region', { name: 'Primary' })).toBeInTheDocument();+ expect(screen.getByRole('region', { name: 'Fallback 1' })).toBeInTheDocument();+ expect(screen.getAllByText(/One paused reviewer skips that whole tier/)).toHaveLength(1);+ expect(screen.queryByText(/Add a configured provider/)).not.toBeInTheDocument();+ expect(screen.queryByText(/Tool-free first/)).not.toBeInTheDocument();+ expect(screen.queryByText(/The first tier with every member unpaused/)).not.toBeInTheDocument();+ expect(screen.queryByLabelText(/Check finished runs against the task objective/)).not.toBeInTheDocument();++ fireEvent.click(screen.getByRole('button', { name: 'How this works' }));+ const help = await screen.findByRole('dialog', { name: 'How code review works' });+ expect(within(help).getByText(/The first tier whose reviewers are all available runs/)).toBeInTheDocument();+ expect(within(help).getByText(/Follow-up is a second check/)).toBeInTheDocument();+ fireEvent.click(screen.getByRole('button', { name: 'Close how code review works' }));+ await waitFor(() => expect(screen.queryByRole('dialog', { name: 'How code review works' })).not.toBeInTheDocument());++ await openFollowUp();+ expect(screen.queryByRole('region', { name: 'Primary' })).not.toBeInTheDocument();+ expect(screen.getByLabelText(/Check finished runs against the task objective/)).toBeInTheDocument();+ expect(screen.getByText(/After a run ships, compare its diff/)).toBeInTheDocument();+ });++ it('sends an unknown task slug back to the review chain', async () => {+ api.getCodeReviewDefaults.mockResolvedValue({ reviewers: ['codex'] });+ renderTab(<CodeReviewersTab />, '/models/code-reviewers/not-a-view');+ expect(await screen.findByRole('region', { name: 'Primary' })).toBeInTheDocument();+ expect(screen.getByRole('tab', { name: 'Review chain' })).toHaveAttribute('aria-selected', 'true');+ });});diff --git a/client/src/components/settings/GoalFidelityControls.jsx b/client/src/components/settings/GoalFidelityControls.jsxindex fd54bbd3c2..d10874f4e5 100644--- a/client/src/components/settings/GoalFidelityControls.jsx+++ b/client/src/components/settings/GoalFidelityControls.jsx@@ -68,7 +68,7 @@ export default function GoalFidelityControls({ value, modelOptions, disabled = f<span><span className="text-sm text-white">Check finished runs against the task objective</span><span className="block text-xs text-gray-500">- After a CoS agent run ships, re-read its accumulated diff against what the task actually asked for — what is missing, what was never requested, whether the work was really verified. A <span className="font-mono">rethink</span> verdict records the run as needing attention instead of complete. Runs only when a local model below (or in the chain above) is available, so leaving it on costs nothing until one is.+ Compares the shipped diff with the task objective. A rethink verdict marks the run as needing attention.</span></span></label>@@ -150,7 +150,7 @@ export default function GoalFidelityControls({ value, modelOptions, disabled = f<span><span className="text-sm text-white">File an issue on the project’s tracker</span><span className="block text-xs text-gray-500">- Writes the finding to whichever tracker the app actually uses — GitHub, GitLab, or JIRA — so it outlives the run record. Re-filing is suppressed by a key carried in the issue body: an existing issue for the same finding is reused even after it has been closed, and a tracker PortOS can’t read refuses the filing rather than risking a duplicate.+ Writes the finding to the project’s tracker. The same finding reuses its existing issue.</span></span></label>@@ -167,7 +167,7 @@ export default function GoalFidelityControls({ value, modelOptions, disabled = f<span><span className="text-sm text-white">Queue an agent to reconcile it</span><span className="block text-xs text-gray-500">- Adds a CoS task that claims the filed issue — or, with no issue filed, works the finding directly. Runs in a worktree behind a PR, and shares the investigation queue’s duplicate guard and hourly circuit breaker, so a repeated drift can’t spawn one agent per run.+ Adds a CoS task that checks the finding before it changes anything.</span></span></label>diff --git a/client/src/pages/Models.jsx b/client/src/pages/Models.jsxindex ce1f97d144..25d527a4f4 100644--- a/client/src/pages/Models.jsx+++ b/client/src/pages/Models.jsx@@ -1,9 +1,11 @@import { Suspense } from 'react';-import { useParams, Navigate } from 'react-router';+import { useLocation, useParams, Navigate } from 'react-router';import { Cpu } from 'lucide-react';+import { getSectionNavTabForPath } from '../../../server/lib/navManifest.js';import PageHeader from '../components/PageHeader';import PageSkeleton from '../components/ui/PageSkeleton';-import ModelsTabsHeader, { ModelsDesktopNavigator } from '../components/models/ModelsTabsHeader';+import ModelsTabsHeader, { ModelsDesktopNavigator, TABS } from '../components/models/ModelsTabsHeader';+import { NAV_PRESENTATION } from '../lib/navPresentation.js';import Image3dRuntimes from '../components/models/Image3dRuntimes';import ModelStatusTab from '../components/models/ModelStatusTab';import SubscriptionsTab from '../components/models/SubscriptionsTab';@@ -85,6 +87,7 @@ const TAB_DETAIL = {export default function Models({ fixedTab, fixedRecordId } = {}) {const params = useParams();+ const { pathname } = useLocation();const tab = fixedTab || params.tab;const recordId = fixedRecordId || params.recordId;const taskView = params.taskView || params.view || (fixedTab === 'performance' && params.assessmentKey ? 'results' : undefined);@@ -104,12 +107,19 @@ export default function Models({ fixedTab, fixedRecordId } = {}) {// `library` and `abuse`); tabs that do not recognize it render their index.const DetailContent = recordId && Object.hasOwn(TAB_DETAIL, activeTab) ? TAB_DETAIL[activeTab] : null;const TabContent = TAB_CONTENT[activeTab];+ // The shell names the destination you are on (Code Reviewers, Performance),+ // matching the section navigator. "Models" stays the area, not the page title.+ // A task view under that destination keeps the destination name; the page's+ // own task row names the view.+ const destination = getSectionNavTabForPath('Models', pathname)+ || TABS.find((item) => item.id === activeTab);+ const DestinationIcon = NAV_PRESENTATION[destination?.to]?.icon || Cpu;return (<div className="flex h-full min-w-0 overflow-hidden"><ModelsDesktopNavigator activeTab={activeTab} /><div className="flex flex-col h-full min-w-0 flex-1">- <PageHeader icon={Cpu} title="Models" />+ <PageHeader icon={DestinationIcon} title={destination?.label || 'Models'} /><ModelsTabsHeader activeTab={activeTab} desktop={false} />diff --git a/client/src/pages/Models.test.jsx b/client/src/pages/Models.test.jsxindex 65ee7abef6..be5c63a625 100644--- a/client/src/pages/Models.test.jsx+++ b/client/src/pages/Models.test.jsx@@ -110,6 +110,23 @@ describe('Models', () => {expect(await screen.findByText('llms panel')).toBeInTheDocument();});+ it('titles the page with the destination instead of the Models section', async () => {+ renderAt('/models/code-reviewers');+ expect(screen.getByRole('heading', { level: 1, name: 'Code Reviewers' })).toBeInTheDocument();+ expect(screen.queryByRole('heading', { level: 1, name: 'Models' })).not.toBeInTheDocument();+ expect(await screen.findByText('code reviewers panel')).toBeInTheDocument();+ });++ it('keeps the destination title on a nested task view', () => {+ renderAt('/models/performance/capabilities');+ expect(screen.getByRole('heading', { level: 1, name: 'Performance' })).toBeInTheDocument();+ });++ it('uses the nested destination name for Abuse Guard', () => {+ renderAt('/models/llms/abuse');+ expect(screen.getByRole('heading', { level: 1, name: 'Abuse Guard' })).toBeInTheDocument();+ });+it('passes an explicit Performance task view through the section shell', async () => {renderAt('/models/performance/capabilities');expect(await screen.findByTestId('assessments-panel')).toHaveAttribute('data-task-view', 'capabilities');diff --git a/docs/CLI_REVIEW_OUTCOMES.md b/docs/CLI_REVIEW_OUTCOMES.mdindex cfa286a3e8..6d1668521a 100644--- a/docs/CLI_REVIEW_OUTCOMES.md+++ b/docs/CLI_REVIEW_OUTCOMES.md@@ -72,6 +72,9 @@ requests that omit this flag continue to inherit the saved defaults.## Primary and fallback tiersModels → Code Reviewers edits saved priority as Primary, Fallback 1, and so on.+The page splits that chain from the follow-up objective check. Shared rules+(which tier runs, dragging, pin sharing, forge reviewers) live in How code+review works, not repeated above each tier.Add a tier, choose a configured provider, then set its model, effort, optionalstatus and round cap on the same row controls used by task and schedule pickers.Standalone / legacy backend retains direct CLI, local runtime and Copilotdiff --git a/docs/UX_DESIGN_GUIDE.md b/docs/UX_DESIGN_GUIDE.mdindex 1525e02a04..0608183685 100644--- a/docs/UX_DESIGN_GUIDE.md+++ b/docs/UX_DESIGN_GUIDE.md@@ -27,7 +27,7 @@ Do not start by placing existing JSX blocks into a larger grid. Decide what belo- A **section navigator** exposes the area's destinations as icon-prefixed, labeled links. Large areas use a vertical navigator on desktop instead of a horizontally overflowing destination strip. Icons are stable visual anchors, not optional decoration to remove for visual minimalism.- One local row of task views is allowed inside a destination, normally 2–5 short labels. If it needs another nested row, promote the destination or use a record detail.- Breadcrumbs show ancestry; they do not replace navigation. Search, command palette, and voice are accelerators, never the only discovery path.-- Page titles name the actual destination: “Jev decision scorer” or “Model performance,” rather than spending a separate header row on “Models” alone.+- Page titles name the actual destination: “Jev decision scorer” or “Model performance,” rather than spending a separate header row on “Models” alone. The Models shell does this with the active section destination’s label and icon. A destination with two jobs uses a local task row under that title; the title does not change per task, and the destination name is not repeated as the first card heading. Explanations that would be copied onto every group live in one help drawer opened from that row.- Keep canonical command IDs, current URLs, aliases, and legacy redirects. Moving a link in navigation does not require moving its route.### Models proposaldiff --git a/server/lib/navManifest.js b/server/lib/navManifest.jsindex f2dabecc02..0a7a816941 100644--- a/server/lib/navManifest.js+++ b/server/lib/navManifest.js@@ -323,6 +323,10 @@ const RAW_NAV_COMMANDS = [{ id: 'nav.models.decision-classifiers', path: '/models/decision-classifiers', label: 'Decision Classifiers', section: 'Models', tabId: 'decision-classifiers', navGroup: 'Policies', aliases: ['decision-classifiers', 'classifiers'], keywords: ['jev', 'laya', 'mlx', 'decision systems', 'experiments'] },{ id: 'nav.models.laya-mlx', path: '/models/decision-classifiers/laya-mlx', label: 'Laya-MLX', section: 'Models', aliases: ['laya', 'laya-mlx', 'layla'], keywords: ['classifier', 'apple silicon', 'typed decisions'] },{ id: 'nav.models.code-reviewers', path: '/models/code-reviewers', label: 'Code Reviewers', section: 'Models', tabId: 'code-reviewers', navGroup: 'Policies', previousPaths: ['/settings/code-reviewers'], aliases: ['code-reviewers', 'settings-code-reviewers', 'code-review', 'review-defaults', 'reviewers'], keywords: ['review loop', 'reviewer chain', 'codex', 'copilot', 'ollama', 'stop mode', 'max rounds', 'defaults'] },+ // A task view of Code Reviewers, not a second sidebar destination. No tabId,+ // so the section navigator stays on Code Reviewers while ⌘K and voice can+ // still open the follow-up check directly.+ { id: 'nav.models.code-reviewers.follow-up', path: '/models/code-reviewers/follow-up', label: 'Reviewer follow-up', section: 'Models', aliases: ['reviewer-follow-up', 'goal-fidelity', 'code-review-follow-up'], keywords: ['objective', 'fidelity', 'rethink', 'file issue', 'finished run', 'follow-up'] },{ id: 'nav.settings.embeddings', path: '/models/embeddings', label: 'Embeddings', section: 'Models', tabId: 'embeddings', navGroup: 'Library', previousPaths: ['/settings/embeddings'], aliases: ['settings-embeddings', 'embeddings', 'embedding'], keywords: ['vector', 'pgvector', 'semantic search', 'nomic', 'ollama', 'lm studio'] },{ id: 'nav.settings.local-llm', path: '/models/llms', label: 'Model Library', section: 'Models', tabId: 'llms', navGroup: 'Library', previousPaths: ['/settings/local-llm'], aliases: ['local-llm', 'local-llms', 'llms', 'models-llms', 'ollama', 'lm-studio', 'lmstudio'], keywords: ['ollama', 'lm studio', 'local model', 'local llm', 'gguf', 'pull model', 'install model', 'migrate', 'switch backend', 'llama.cpp'] },{ id: 'nav.models.llms.abuse', path: '/models/llms/abuse', label: 'Abuse Guard', section: 'Models', tabId: 'abuse', navGroup: 'Policies', aliases: ['abuse-guard', 'model-abuse', 'model-abuse-guard', 'prompt-guard', 'prompt guard'], keywords: ['classifier', 'prompt injection', 'security scan', 'llama prompt guard', 'install guard'] },