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

address review (codex): adopt short positive browser pages past a wall, sync ledger found flag on manual verdict transitions

[._.]/ Adam Eivybbf499a6efe3
diff --git a/server/services/privacyBrokers.db.test.js b/server/services/privacyBrokers.db.test.js
index 4513ad0211..94bcb8a5f4 100644
--- a/server/services/privacyBrokers.db.test.js
+++ b/server/services/privacyBrokers.db.test.js
@@ -133,6 +133,23 @@ describe.skipIf(!dbReady)('privacy brokers DB round-trip', () => {
expect(new Date(removed.nextRecheckAt).toISOString()).toBe('2026-08-07T00:00:00.000Z'); // +30d
});
+ it('a manual transition onto a verdict state syncs the ledger found flag', async () => {
+ const now = new Date('2026-07-08T00:00:00.000Z');
+ // ca-test-beta-inc: its case is untouched by the lifecycle test above
+ // (test-auto-alpha's case ends at confirmed_removed, which blocked can't
+ // be recorded over).
+ const kase = await svc.recordScanVerdict('ca-test-beta-inc', 'blocked', {
+ evidence: { match_basis: 'antibot_wall', search_url: 'https://beta.example/jane' }, now,
+ });
+ expect(kase.found).toBe(null);
+ // The blocked-case "I'm listed" manual verdict implies found: true.
+ const confirmed = await svc.transitionCase(kase.id, 'found');
+ expect(confirmed.found).toBe(true);
+ // And a manual not_found implies found: false; explicit patch still wins.
+ const dismissed = await svc.transitionCase(kase.id, 'not_found');
+ expect(dismissed.found).toBe(false);
+ });
+
it('runScanPass scans due brokers, records verdicts, and skips opt-out-owned cases', async () => {
// A scan-eligible name so buildSearchVectors is non-empty.
const nameRec = await vault.createVaultRecord({ type: 'legal_name', label: 'Legal name', value: 'Jane Q Publictest' });
diff --git a/server/services/privacyBrokers.js b/server/services/privacyBrokers.js
index ebe35fe0d3..0902948989 100644
--- a/server/services/privacyBrokers.js
+++ b/server/services/privacyBrokers.js
@@ -478,7 +478,14 @@ export async function transitionCase(caseId, toState, patch = {}) {
const sets = ['state = $1', 'next_recheck_at = $2', 'updated_at = NOW()'];
const params = [toState, computeNextRecheckAt(toState, now)];
const add = (column, value) => { params.push(value); sets.push(`${column} = $${params.length}`); };
- if (patch.found !== undefined) add('found', patch.found);
+ // A transition onto a verdict state implies the ledger's `found` flag
+ // (e.g. the blocked-case manual "I'm listed" → found), unless the caller
+ // supplied an explicit patch.found. indirect_exposure stays null: a
+ // name-only match is an unknown, not a confirmed listing.
+ const impliedFound = { found: true, not_found: false, indirect_exposure: null };
+ const foundValue = patch.found !== undefined ? patch.found
+ : (toState in impliedFound ? impliedFound[toState] : undefined);
+ if (foundValue !== undefined) add('found', foundValue);
if (patch.channel !== undefined) add('channel', patch.channel);
if (patch.reason !== undefined) add('reason', patch.reason);
if (patch.disclosedFields !== undefined) add('disclosed_fields', patch.disclosedFields);
diff --git a/server/services/privacyScan.js b/server/services/privacyScan.js
index 884911b44e..299d366b23 100644
--- a/server/services/privacyScan.js
+++ b/server/services/privacyScan.js
@@ -250,9 +250,21 @@ export async function probeBroker(broker, vectors, {
const jsShell = result && !walled && status >= 200 && status < 400 && looksLikeJsShell(html);
if (walled || jsShell) {
const browsed = await browserFetch(url).catch(() => null);
- if (browsed?.text && (jsShell || !looksLikeJsShell(browsed.text))) {
- html = browsed.text;
- status = 200;
+ if (browsed?.text) {
+ if (jsShell || !looksLikeJsShell(browsed.text)) {
+ html = browsed.text;
+ status = 200;
+ } else {
+ // Wall + shell-length browsed text: adopt only when it carries a
+ // positive name signal — a concise page naming the person is a real
+ // result, while a short page without it is indistinguishable from a
+ // challenge shell and must stay `blocked` (never become not_found).
+ const peek = classifyScanResult({ status: 200, html: browsed.text, vectors, broker });
+ if (peek.verdict === 'found' || peek.verdict === 'indirect_exposure') {
+ html = browsed.text;
+ status = 200;
+ }
+ }
}
}
diff --git a/server/services/privacyScan.test.js b/server/services/privacyScan.test.js
index 91d7864167..beaa149b41 100644
--- a/server/services/privacyScan.test.js
+++ b/server/services/privacyScan.test.js
@@ -178,6 +178,15 @@ describe('scanBroker — classify → record wiring', () => {
expect(res.state).toBe('blocked');
});
+ it('adopts a SHORT browser page after a wall when it carries a positive name signal', async () => {
+ brokers.recordScanVerdict.mockClear();
+ const fetchImpl = vi.fn(async () => ({ status: 403, text: async () => 'Access denied' }));
+ // Concise real result page (< JS-shell length) naming the person + city.
+ const browserFetch = vi.fn(async () => ({ text: 'Jane Q Doe — Portland, OR. 1 record.' }));
+ const res = await scanBroker(broker, vectors, { fetchImpl, browserFetch, urlSafe: async () => true });
+ expect(res.state).toBe('found');
+ });
+
it('a 404 carrying an incidental antibot token stays inconclusive (no wall escalation)', async () => {
brokers.recordScanVerdict.mockClear();
const fetchImpl = vi.fn(async () => ({ status: 404, text: async () => 'Not found — report a problem (reCAPTCHA)' }));