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
privacy: escalate walled broker scans to the browser lane and make blocked cases actionable
[._.]/ Adam Eivye7120710aaff
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex bbaa52a370..648d85dfde 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -117,3 +117,5 @@- **[issue-2389] The Sharing page's per-bucket detail tab (Inbox / Activity / Settings) is now URL-derived and history-safe.** The sub-tab was held in component-local `useState('inbox')`, so it wasn't deep-linkable and browser back/forward could disagree with the visible tab. It now derives from a validated `?tab=` search param via `useDrawerTab('tab', 'inbox', BUCKET_TAB_IDS)` — a direct link opens the named tab, a stale/hand-edited value degrades to Inbox, and switching buckets (a fresh route without the query) resets to Inbox. New render tests cover the direct-link, invalid-fallback, and back/forward cases.- **[issue-2374] Universe Builder page decomposed — controller hook + shared/count libs + tab components extracted.** `client/src/pages/UniverseBuilder.jsx` was ~3,700 lines with render-job orchestration, shared constants, prompt-count math, and several full tab/editor components all inline. This slice pulls out the independently-testable pieces without changing behavior or the URL-source-of-truth navigation: a `useRenderJobQueue` controller hook (the per-entry `pendingByEntryId` queue, head-map, enqueue/clear reducer), two pure libs — `universeBuilderShared` (trunk/tab/composite constants + category helpers) and `universeBuilderCounts` (server-mirrored `renderPromptCount`/`scopedPromptCount`/canon-content helpers) — and three tab/editor components moved to `components/universeBuilder/` (`CompositeSheetsEditor`, `BucketChipStrip`, `RenderTab`). Each extraction ships with unit tests; the existing `CategoryEditor`/`TrunkView`/`OtherTab`/`UniverseSelector` test seam is preserved. The page drops ~810 lines. Remaining tab extractions (CategoryEditor, VariationCard, BibleTab, TrunkView, OtherTab) and a fuller page-orchestration hook are deferred.++- **Privacy broker scan: `blocked` verdicts are now rarer, explained, and actionable.** Most people-search brokers wall off automated checks (a live probe of the 16 seeded brokers found every opt-out page except Spokeo and PeopleConnect returning 403 even to a browser user agent), and the scan surfaced that as an unexplained red "Blocked" chip with no next step. Four fixes: (1) a 403/antibot wall now escalates to the pinned real-Chrome fetch before recording `blocked` — a real browser passes many passive bot checks (interactive challenges still classify as blocked, never solved), and a shell-length browsed page can't flip a wall into a false `not_found`; (2) the antibot markers are challenge-specific — the bare `cloudflare` token falsely classified any 200 result page referencing a Cloudflare CDN script as blocked; (3) every recorded verdict carries the filled `search_url` as evidence, so the case drawer and human-task digest offer **Check manually in your browser** on blocked cases — the human is the sanctioned path past a bot wall; (4) blocked cases got manual verdict actions (**I'm listed** → `found`, dismiss → `not_found`), replacing the drawer/digest's "Mark submitted" which always failed server-side (`blocked → submitted` is not a legal case transition), plus an explainer and a warning (not error) tone — blocked means "unknown, needs you," not "exposure confirmed."diff --git a/client/src/components/privacy/BrokerCaseDrawer.jsx b/client/src/components/privacy/BrokerCaseDrawer.jsxindex 82a9db0dde..17ec4c21a5 100644--- a/client/src/components/privacy/BrokerCaseDrawer.jsx+++ b/client/src/components/privacy/BrokerCaseDrawer.jsx@@ -1,7 +1,7 @@import { RotateCw, ExternalLink, CheckCircle2, XCircle, ListChecks } from 'lucide-react';import Drawer from '../Drawer';import { timeAgo, formatDateShort } from '../../utils/formatters';-import { CASE_STATE_TONE, labelFor, CASE_STATES } from './constants';+import { CASE_STATE_TONE, MANUAL_DONE_ACTION, labelFor, CASE_STATES } from './constants';// Read-only case inspector + manual controls (issue #2146). Deep-linked open// state is owned by the parent (a `?case=<id>` search param), so this component@@ -18,10 +18,14 @@ export default function BrokerCaseDrawer({const listingUrls = Array.isArray(evidence.listing_urls) ? evidence.listing_urls : [];const playbook = Array.isArray(broker?.optout?.playbook) ? broker.optout.playbook : [];const optoutUrl = broker?.optout?.url || evidence.optout_url || null;+ const searchUrl = evidence.search_url || null;- // Which manual transitions make sense from the current state.+ // Which manual transitions make sense from the current state. The positive+ // resolution per state (and its legality) lives in MANUAL_DONE_ACTION —+ // shared with the digest strip so the two can't drift.const state = caseData?.state;- const canMarkDone = state === 'human_task_queued' || state === 'blocked';+ const isBlocked = state === 'blocked';+ const doneAction = MANUAL_DONE_ACTION[state];const canDismiss = state === 'human_task_queued' || state === 'blocked' || state === 'found' || state === 'indirect_exposure';const Row = ({ label, children }) => (@@ -68,6 +72,26 @@ export default function BrokerCaseDrawer({{caseData.reason && <Row label="Reason">{caseData.reason}</Row>}+ {isBlocked && (+ <div className="text-xs text-gray-300 bg-port-warning/5 border border-port-warning/30 rounded p-2.5 space-y-1.5">+ <p>+ This broker blocks automated checks, so your exposure here is <span className="text-white">unknown</span> —+ not confirmed. Open the same search in your own browser (real browsers pass these walls),+ then record what you find below.+ </p>+ {searchUrl && (+ <a+ href={searchUrl}+ target="_blank"+ rel="noreferrer"+ className="inline-flex items-center gap-1 text-port-accent hover:underline"+ >+ <ExternalLink size={12} /> Check manually in your browser+ </a>+ )}+ </div>+ )}+<Row label="Disclosed fields">{(caseData.disclosedFields || []).length? (caseData.disclosedFields || []).map((f) => (@@ -119,13 +143,13 @@ export default function BrokerCaseDrawer({><RotateCw size={14} /> Force re-check</button>- {canMarkDone && (+ {doneAction && (<button- onClick={() => onTransition?.(caseData, 'submitted')}+ onClick={() => onTransition?.(caseData, doneAction.target)}disabled={busy}- className="inline-flex items-center gap-1.5 px-3 py-2 text-sm rounded border border-port-success/40 text-port-success hover:bg-port-success/10 disabled:opacity-50"+ className={`inline-flex items-center gap-1.5 px-3 py-2 text-sm rounded border ${doneAction.buttonTone} disabled:opacity-50`}>- <CheckCircle2 size={14} /> Mark submitted+ <CheckCircle2 size={14} /> {doneAction.label}</button>)}{canDismiss && (diff --git a/client/src/components/privacy/PrivacyBrokersTab.jsx b/client/src/components/privacy/PrivacyBrokersTab.jsxindex 8e66b0cbc3..816f0eec21 100644--- a/client/src/components/privacy/PrivacyBrokersTab.jsx+++ b/client/src/components/privacy/PrivacyBrokersTab.jsx@@ -14,7 +14,8 @@ import toast from '../ui/Toast';import { timeAgo, formatDateShort } from '../../utils/formatters';import BrokerCaseDrawer from './BrokerCaseDrawer';import {- CASE_STATES, CASE_STATE_TONE, EXPOSURE_MAP_STATES, BROKER_SOURCES, BROKER_CONFIDENCE, labelFor,+ CASE_STATES, CASE_STATE_TONE, EXPOSURE_MAP_STATES, BROKER_SOURCES, BROKER_CONFIDENCE,+ MANUAL_DONE_ACTION, labelFor,} from './constants';// Stat chip for the exposure-map header.@@ -269,14 +270,24 @@ export default function PrivacyBrokersTab() {{item.reason && <div className="text-[11px] text-gray-500 mt-0.5">{item.reason}{item.channel ? ` · ${item.channel}` : ''}</div>}</div><div className="flex items-center gap-1 shrink-0">+ {item.state === 'blocked' && item.searchUrl && (+ <a href={item.searchUrl} target="_blank" rel="noreferrer" title="Check manually in your browser" aria-label="Check manually in your browser" className="p-1.5 rounded text-gray-400 hover:text-white hover:bg-port-border/50">+ <Search size={15} />+ </a>+ )}{item.optoutUrl && (<a href={item.optoutUrl} target="_blank" rel="noreferrer" title="Open opt-out page" aria-label="Open opt-out page" className="p-1.5 rounded text-gray-400 hover:text-white hover:bg-port-border/50"><ExternalLink size={15} /></a>)}- <button onClick={() => doTransition({ id: item.caseId }, 'submitted')} disabled={caseBusy} title="Mark done" aria-label="Mark done" className="p-1.5 rounded text-port-success hover:bg-port-success/10 disabled:opacity-50">- <CheckCircle2 size={15} />- </button>+ {(() => {+ const done = MANUAL_DONE_ACTION[item.state] || MANUAL_DONE_ACTION.human_task_queued;+ return (+ <button onClick={() => doTransition({ id: item.caseId }, done.target)} disabled={caseBusy} title={done.label} aria-label={done.label} className={`p-1.5 rounded ${done.chipTone} disabled:opacity-50`}>+ <CheckCircle2 size={15} />+ </button>+ );+ })()}<button onClick={() => doTransition({ id: item.caseId }, 'not_found')} disabled={caseBusy} title="Dismiss" aria-label="Dismiss" className="p-1.5 rounded text-gray-400 hover:text-white hover:bg-port-border/50 disabled:opacity-50"><XCircle size={15} /></button>diff --git a/client/src/components/privacy/PrivacyBrokersTab.test.jsx b/client/src/components/privacy/PrivacyBrokersTab.test.jsxindex 366f8ea9f0..0797bb5080 100644--- a/client/src/components/privacy/PrivacyBrokersTab.test.jsx+++ b/client/src/components/privacy/PrivacyBrokersTab.test.jsx@@ -20,7 +20,15 @@ const api = vi.hoisted(() => ({{ id: 'c2', brokerId: 'wp', brokerName: 'WhitePages', state: 'confirmed_removed', evidence: {}, updatedAt: '2026-07-02T00:00:00.000Z' },],brokers: [{ id: 'spokeo', name: 'Spokeo', tier: 1, source: 'curated', confidence: 'documented', enabled: true, clusterParent: null, optout: {} }],- digest: { total: 1, humanTasks: 1, blocked: 0, items: [{ caseId: 'h1', brokerId: 'bv', brokerName: 'BeenVerified', state: 'human_task_queued', reason: 'human_only_channel' }] },+ digest: {+ total: 2,+ humanTasks: 1,+ blocked: 1,+ items: [+ { caseId: 'h1', brokerId: 'bv', brokerName: 'BeenVerified', state: 'human_task_queued', reason: 'human_only_channel' },+ { caseId: 'b1', brokerId: 'rad', brokerName: 'Radaris', state: 'blocked', reason: 'antibot_wall', searchUrl: 'https://rad/p/Jane/Doe/' },+ ],+ },schedule: { enabled: false, cronExpression: '0 4 * * 0', autoApproveOptOutEmails: false, autoSubmitWebForms: false, nextRun: null },runScanDeferred: null,}));@@ -72,6 +80,17 @@ describe('PrivacyBrokersTab', () => {await waitFor(() => expect(apiMod.transitionPrivacyCase).toHaveBeenCalledWith('h1', 'submitted', undefined, expect.anything()));});+ it('a blocked digest item offers a manual-check link and transitions to found (not submitted)', async () => {+ renderTab();+ await screen.findByText('Radaris');+ // Manual browser check opens the filled search URL.+ const manualLink = screen.getByLabelText('Check manually in your browser');+ expect(manualLink.getAttribute('href')).toBe('https://rad/p/Jane/Doe/');+ // blocked → submitted is not a legal transition; the positive action is found.+ fireEvent.click(screen.getByLabelText("I'm listed"));+ await waitFor(() => expect(apiMod.transitionPrivacyCase).toHaveBeenCalledWith('b1', 'found', undefined, expect.anything()));+ });+it('disables both run buttons while a pass is in flight', async () => {api.runScanDeferred = deferred();renderTab();diff --git a/client/src/components/privacy/constants.js b/client/src/components/privacy/constants.jsindex 22a93bbf3e..1fdc688412 100644--- a/client/src/components/privacy/constants.js+++ b/client/src/components/privacy/constants.js@@ -112,7 +112,9 @@ export const CASE_STATE_TONE = {found: 'bg-port-error/15 text-port-error border-port-error/30',not_found: 'bg-gray-700/40 text-gray-400 border-gray-600/40',indirect_exposure: 'bg-port-warning/15 text-port-warning border-port-warning/30',- blocked: 'bg-port-error/15 text-port-error border-port-error/30',+ // Warning (not error) tone: blocked means "unknown — needs a manual check,"+ // not "exposure confirmed."+ blocked: 'bg-port-warning/15 text-port-warning border-port-warning/30',optout_in_progress: 'bg-port-accent/15 text-port-accent border-port-accent/30',submitted: 'bg-port-accent/15 text-port-accent border-port-accent/30',verification_pending: 'bg-port-accent/15 text-port-accent border-port-accent/30',@@ -129,6 +131,27 @@ export const EXPOSURE_MAP_STATES = ['blocked', 'human_task_queued', 'not_found',];+// Positive-resolution action for the case states a human resolves by hand+// (drawer + digest action strips both render from this map, so the rule lives+// in ONE place). Mirrors the server's STATE_TRANSITIONS legality+// (privacyBrokers.js): blocked → submitted is NOT a legal transition — a+// blocked case's positive outcome is a manual "I'm listed" (found), while a+// queued human task's is "Mark done" (submitted).+export const MANUAL_DONE_ACTION = {+ blocked: {+ target: 'found',+ label: "I'm listed",+ chipTone: 'text-port-error hover:bg-port-error/10',+ buttonTone: 'border-port-error/40 text-port-error hover:bg-port-error/10',+ },+ human_task_queued: {+ target: 'submitted',+ label: 'Mark done',+ chipTone: 'text-port-success hover:bg-port-success/10',+ buttonTone: 'border-port-success/40 text-port-success hover:bg-port-success/10',+ },+};+export const BROKER_SOURCES = [{ id: 'curated', label: 'Curated' },{ id: 'badbool', label: 'BADBOOL' },diff --git a/server/services/privacyOptOut.js b/server/services/privacyOptOut.jsindex add35af54e..b07da5b5d5 100644--- a/server/services/privacyOptOut.js+++ b/server/services/privacyOptOut.js@@ -528,6 +528,9 @@ export async function getOptOutDigest() {channel: c.channel || null,disclosedFields: c.disclosedFields || [],optoutUrl: c.evidence?.optout_url || null,+ // Filled broker-search URL for blocked cases — lets the digest offer+ // "check manually in your browser" (the sanctioned path past a bot wall).+ searchUrl: c.evidence?.search_url || null,playbook: c.evidence?.playbook || [],nextRecheckAt: c.nextRecheckAt,});diff --git a/server/services/privacyOptOut.test.js b/server/services/privacyOptOut.test.jsindex 60e620272f..4a3352fd4b 100644--- a/server/services/privacyOptOut.test.js+++ b/server/services/privacyOptOut.test.js@@ -307,7 +307,7 @@ describe('getOptOutDigest', () => {it('aggregates human-task + blocked cases with playbook + reason', async () => {listBrokerCases.mockImplementation(async ({ state } = {}) => {if (state === 'human_task_queued') return [{ id: 'h1', brokerId: 'wp', brokerName: 'Whitepages', state, reason: 'auto_submit_disabled', evidence: { optout_url: 'https://wp/o', playbook: ['call back'] } }];- if (state === 'blocked') return [{ id: 'b1', brokerId: 'rad', brokerName: 'Radaris', state, reason: 'antibot_wall', evidence: {} }];+ if (state === 'blocked') return [{ id: 'b1', brokerId: 'rad', brokerName: 'Radaris', state, reason: 'antibot_wall', evidence: { search_url: 'https://rad/p/Jane/Doe/' } }];return [];});const digest = await getOptOutDigest();@@ -315,5 +315,7 @@ describe('getOptOutDigest', () => {expect(digest.humanTasks).toBe(1);expect(digest.blocked).toBe(1);expect(digest.items[0].playbook).toEqual(['call back']);+ // Blocked items surface the filled search URL for a manual browser check.+ expect(digest.items[1].searchUrl).toBe('https://rad/p/Jane/Doe/');});});diff --git a/server/services/privacyScan.js b/server/services/privacyScan.jsindex c6ee2ba4fb..4b61ed8948 100644--- a/server/services/privacyScan.js+++ b/server/services/privacyScan.js@@ -36,11 +36,14 @@ const HTTP_FETCH_TIMEOUT_MS = 15000;// likely saw an SPA shell — escalate to the browser lane.const JS_SHELL_MAX_LEN = 600;const JS_WALL_MARKERS = ['enable javascript', 'please enable js', 'noscript', '__next_data__'];-// Antibot / hard-challenge markers — record `blocked`, never solve.+// Antibot / hard-challenge markers — record `blocked`, never solve. Challenge-+// specific tokens only: a bare vendor name like "cloudflare" appears in CDN+// script URLs on legitimate 200 result pages and would false-positive.const ANTIBOT_MARKERS = ['captcha', 'recaptcha', 'hcaptcha', 'px-captcha', 'unusual traffic',- 'are you a human', 'cf-browser-verification', 'access denied', 'request blocked',- 'verify you are human', 'cloudflare', 'bot detection',+ 'are you a human', 'cf-browser-verification', 'cf-chl', 'challenge-platform',+ 'just a moment', 'access denied', 'request blocked',+ 'verify you are human', 'bot detection',];// ─── Search vectors (pure) ──────────────────────────────────────────────────@@ -134,6 +137,13 @@ function containsAntibot(html) {return ANTIBOT_MARKERS.some((m) => h.includes(m));}+// The one definition of "this response is a bot wall" — shared by the blocked+// verdict in classifyScanResult and the escalation gate in probeBroker so the+// two can't drift.+function isWall(status, html) {+ return status === 403 || containsAntibot(html);+}+function looksLikeJsShell(html) {if (!html || html.length < JS_SHELL_MAX_LEN) return true;const h = html.toLowerCase();@@ -153,7 +163,7 @@ function looksLikeJsShell(html) {*/export function classifyScanResult({ status, html = '', vectors = {}, broker = {} }) {if (status === 404) return { verdict: null, inconclusive: true, evidence: { match_basis: 'http_404' } };- if (status === 403 || containsAntibot(html)) {+ if (isWall(status, html)) {return { verdict: 'blocked', evidence: { match_basis: 'antibot_wall', http_status: status } };}if (status && status >= 500) return { verdict: null, inconclusive: true, evidence: { match_basis: `http_${status}` } };@@ -233,10 +243,20 @@ export async function probeBroker(broker, vectors, {let html = result?.html ?? '';let status = result?.status ?? null;- // Escalate to the pinned browser lane when the static fetch saw a JS shell.- if (result && result.status >= 200 && result.status < 400 && looksLikeJsShell(html) && !containsAntibot(html)) {+ // Escalate to the pinned browser lane when the static fetch saw a JS shell,+ // OR hit a bot wall (403/antibot markers). A real-Chrome fetch is a+ // legitimate client that passes many PASSIVE bot checks — an interactive+ // challenge in the browsed page still classifies as `blocked` below (never+ // solved). On a wall, only adopt substantive browsed content: a shell-length+ // browsed page would otherwise flip a real wall into a false `not_found`.+ const walled = result && isWall(status, html);+ const jsShell = result && !walled && status >= 200 && status < 400 && looksLikeJsShell(html);+ if (walled || jsShell) {const browsed = await browserFetch(url).catch(() => null);- if (browsed?.text) { html = browsed.text; status = 200; }+ if (browsed?.text && (jsShell || !looksLikeJsShell(browsed.text))) {+ html = browsed.text;+ status = 200;+ }}if (!result && !html) {@@ -245,7 +265,9 @@ export async function probeBroker(broker, vectors, {}const classified = classifyScanResult({ status, html, vectors, broker });- const evidence = { ...classified.evidence, listing_urls: classified.verdict === 'found' ? [url] : [] };+ // search_url lets the UI offer "check manually in your browser" on blocked+ // cases — the human IS the sanctioned path past an antibot wall.+ const evidence = { ...classified.evidence, search_url: url, listing_urls: classified.verdict === 'found' ? [url] : [] };if (classified.inconclusive || !classified.verdict) {return { skipped: true, reason: classified.evidence?.match_basis || 'inconclusive', verdict: null, evidence };}diff --git a/server/services/privacyScan.test.js b/server/services/privacyScan.test.jsindex 99114d600a..0e7d575878 100644--- a/server/services/privacyScan.test.js+++ b/server/services/privacyScan.test.js@@ -98,6 +98,18 @@ describe('classifyScanResult', () => {const r = classifyScanResult({ status: 200, html: 'Nobody here by that description', vectors });expect(r.verdict).toBe('not_found');});+ it('a bare CDN mention of "cloudflare" on a real result page is NOT a wall', () => {+ const r = classifyScanResult({+ status: 200,+ html: '<script src="https://cdnjs.cloudflare.com/x.js"></script> Results for Jane Q Doe of Portland OR',+ vectors,+ });+ expect(r.verdict).toBe('found');+ });+ it('a Cloudflare interstitial ("Just a moment...") → blocked', () => {+ const r = classifyScanResult({ status: 200, html: '<title>Just a moment...</title>', vectors });+ expect(r.verdict).toBe('blocked');+ });});describe('scanBroker — classify → record wiring', () => {@@ -132,4 +144,34 @@ describe('scanBroker — classify → record wiring', () => {const res = await scanBroker(broker, vectors, { urlSafe: async () => false });expect(res).toEqual({ skipped: true, reason: 'unsafe_or_unfillable_url' });});++ it('escalates a 403 wall to the browser lane and records its verdict', async () => {+ brokers.recordScanVerdict.mockClear();+ const fetchImpl = vi.fn(async () => ({ status: 403, text: async () => 'Access denied' }));+ // Substantive real-Chrome page (long enough to not look like a JS shell).+ const page = `Results for Jane Q Doe in Portland, OR — full profile. ${'x'.repeat(700)}`;+ const browserFetch = vi.fn(async () => ({ text: page }));+ const res = await scanBroker(broker, vectors, { fetchImpl, browserFetch, urlSafe: async () => true });+ expect(browserFetch).toHaveBeenCalledWith('https://b.example/Jane-Doe/OR');+ expect(res.state).toBe('found');+ });++ it('records blocked (with the search URL as evidence) when the browser lane also walls', async () => {+ brokers.recordScanVerdict.mockClear();+ const fetchImpl = vi.fn(async () => ({ status: 403, text: async () => 'Access denied' }));+ const browserFetch = vi.fn(async () => null);+ const res = await scanBroker(broker, vectors, { fetchImpl, browserFetch, urlSafe: async () => true });+ expect(res.state).toBe('blocked');+ expect(brokers.recordScanVerdict).toHaveBeenCalledWith('spokeo', 'blocked', expect.objectContaining({+ evidence: expect.objectContaining({ match_basis: 'antibot_wall', search_url: 'https://b.example/Jane-Doe/OR' }),+ }));+ });++ it('does NOT adopt a shell-length browser page on a wall (stays blocked, not not_found)', async () => {+ brokers.recordScanVerdict.mockClear();+ const fetchImpl = vi.fn(async () => ({ status: 403, text: async () => 'Access denied' }));+ const browserFetch = vi.fn(async () => ({ text: 'Just a moment' }));+ const res = await scanBroker(broker, vectors, { fetchImpl, browserFetch, urlSafe: async () => true });+ expect(res.state).toBe('blocked');+ });});