← Commit history

Profile-consistency doctrine from John: every pup window ALWAYS opens on the shared adom-you profile, and isolation becomes reason-gated exactly like foregrounding — an explicit isolated:true without an isolationReason is refused with a teaching hint, while the two definitional cases, webSecurity false and the wiki public view, carry their own built-in reason. And a window that does run on an alternate profile now still shows an identity tile: a new anonymous variant with the pup four-dot mark set in the circular avatar inset, whose popup card explains the window is not signed in as you, so a not-you window is visible at a glance instead of just missing an avatar

John Lauer ·9d84b0a2e9 ·2mo ago ·parent 0e5c852
9 files changed +56−9
adom-bridge-puppeteer-manifest.json+4−4
@@ -1,10 +1,10 @@ {   "manifest_version": 1,   "name": "puppeteer",-  "version": "2.0.100",-  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.100/adom-bridge-puppeteer-v2.0.100.zip",-  "sha256": "210a76ea998e3cc711d89ad495325b0593296c2d82c52536e74cbe11b27f99e2",-  "size": 845363,+  "version": "2.0.101",+  "url": "https://wiki.adom.inc/download/adom/pup-bridge/2.0.101/adom-bridge-puppeteer-v2.0.101.zip",+  "sha256": "af822745ebade741d228672d640775d642d66bb1464d95c48b112545e53f73b9",+  "size": 853514,   "verbPrefixes": [     "browser_",     "desktop_recorder_",
src/BRIDGE_VERSION+1−1
@@ -1 +1 @@-2.0.100+2.0.101
src/bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "puppeteer",   "displayName": "Puppeteer (Chrome for Testing + Native)",-  "version": "2.0.100",+  "version": "2.0.101",   "description": "Drives a browser ALREADY on the machine \u2014 installed Chrome, else Microsoft Edge (every Windows PC ships with Edge) \u2014 launched with a FRESH isolated profile, so the common case has NO ~150 MB Chrome-for-Testing download and it never touches the user's real tabs/logins. Binds its local server to LOOPBACK (127.0.0.1) only, so no Windows Firewall 'allow Node through the firewall' prompt ever pops. Chrome for Testing is fetched only as a LAST RESORT if the machine has no Chromium browser at all. SPAWN-VERIFIED fallback: pup tries each detected browser (Chrome \u2192 Edge \u2192 CfT) and actually launches it, falling through to the next if one won't start (and handling browsers like Edge that relaunch onto another PID), so a corrupt/partial install never hard-fails an open. The browser that launches is cached as the default (persisted across restarts) so it isn't re-probed each time. On spawn the bridge SELF-WARMS: detects browsers + disk, and only if the box has no Chrome/Edge and no cached CfT does it background-fetch CfT so the first open is instant. pup_use pins a specific browser (chrome | edge | cft | auto); {browser:'chrome',install:true} downloads & installs REAL Google Chrome (user-scoped, no admin) on an Edge-only box. pup_readiness (READ-ONLY) reports which browser will be used + the full candidate list + the default + free disk. Every failure returns a specific errorCode + _hint (chrome_install_no_disk, chrome_download_network, chrome_install_permission, chrome_stable_not_detected, \u2026). Launches with FULL browser permissions by default for full debug (strictPermissions:true opts out). Headful automation: open/close windows+tabs, navigate, screenshot, eval JS, record. pup is a GENERIC, non-profile browser only \u2014 every session is a fresh isolated Chrome/Edge process, never the user's real signed-in browser; profile defaults to sessionId. To drive the user's REAL Chrome/Edge (their profile, cookies, SSO), use the Adom browser EXTENSION's nbrowser_* verbs \u2014 a separate bridge, not pup's job. macOS (v1.9.74+): full parity with mac-native mechanics \u2014 background-by-default is the app-level hide (windows stay drivable/screenshottable while hidden), raise/lower map to unhide+activate/hide, pup_alert_window posts a native toast whose click focuses the window, pup_use {browser:'chrome',install:true} installs Chrome from the official dmg, and taskbar identity/badging remains Windows-only.",   "homepage": "https://wiki.adom.inc/adom/adom-bridge",   "author": "Adom Inc.",
src/extension-identity-anon/anon.htmladded+23
@@ -0,0 +1,23 @@+<!doctype html><html><head><meta charset="utf-8"><style>+  :root { color-scheme: dark; }+  body { margin: 0; width: 260px; background: #0d1117; color: #c9d1d9;+    font: 400 13px 'Segoe UI', system-ui, sans-serif; border: 1px solid #30363d; }+  .hdr { display: flex; align-items: center; gap: 10px; padding: 12px 14px;+    border-bottom: 1px solid #30363d; background: #161b22; }+  .mark { width: 30px; height: 30px; border-radius: 8px; background: #00b8b1; display: grid; place-items: center; flex: none; }+  .mark .disc { width: 24px; height: 24px; border-radius: 50%; background: #003d40; display: grid; place-items: center; }+  .t { font-weight: 700; color: #e6edf3; }+  .sub { font-size: 11px; color: #8b949e; }+  .body { padding: 12px 14px; line-height: 1.55; }+  .body b { color: #e6edf3; }+</style></head><body>+  <div class="hdr">+    <div class="mark"><div class="disc"><svg viewBox="0 0 24 24" width="15" height="15" fill="#00b8b1">+      <circle cx="7" cy="6" r="2.4"/><circle cx="15" cy="9.5" r="2.4"/>+      <circle cx="7" cy="13" r="2.4"/><circle cx="15" cy="16.5" r="2.4"/></svg></div></div>+    <div><div class="t">Anonymous profile</div><div class="sub">isolated throwaway jar</div></div>+  </div>+  <div class="body">This window is <b>not signed in as you</b>. It runs on an isolated profile:+  logins made here stay in this window and do not enrich your shared <b>adom-you</b> credential+  store. Windows signed in as you show your avatar here instead.</div>+</body></html>
src/extension-identity-anon/icon128.pngadded
⋯ 1 unchanged line ⋯
src/extension-identity-anon/icon16.pngadded
⋯ 1 unchanged line ⋯
src/extension-identity-anon/icon48.pngadded
⋯ 1 unchanged line ⋯
src/extension-identity-anon/manifest.jsonadded+8
@@ -0,0 +1,8 @@+{+  "manifest_version": 3,+  "name": "Adom Identity (anonymous profile)",+  "version": "0.1.0",+  "description": "This window runs on an isolated throwaway profile, not signed in as you.",+  "action": { "default_popup": "anon.html", "default_title": "Anonymous profile — this window is not signed in as you" },+  "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }+}
src/server.js+19−3
@@ -2488,7 +2488,7 @@ function prepareCleanProfile(userDataDir) {       if (pupSettings().toolbarExtension !== 'off') {         prefs.extensions = prefs.extensions || {};         const pins = Array.isArray(prefs.extensions.pinned_extensions) ? prefs.extensions.pinned_extensions : [];-        for (const d of [path.join(os.homedir(), '.adom', 'pup-annotate-extension'), path.join(os.homedir(), '.adom', 'pup-extension'), path.join(os.homedir(), '.adom', 'pup-identity-extension')]) {+        for (const d of [path.join(os.homedir(), '.adom', 'pup-annotate-extension'), path.join(os.homedir(), '.adom', 'pup-extension'), path.join(os.homedir(), '.adom', 'pup-identity-extension'), path.join(os.homedir(), '.adom', 'pup-identity-anon-extension')]) {           const id2 = unpackedExtensionId(d);           if (!pins.includes(id2)) pins.push(id2);         }@@ -8326,7 +8326,10 @@ async function getOrLaunchBrowser(profileName, { freshProfile = false, strictPer     // v2.0.53/57: stage the extensions; CfT candidates carry them as --load-extension below.     // The identity extension rides ONLY adom-you (throwaway profiles must not claim the identity).     const _tbExtDir = stageToolbarExtension();-    const _idExtDir = (path.basename(userDataDir || '') === 'adom-you') ? await stageIdentityExtension() : null;+    // v2.0.101 (John): a non-adom-you window still shows an identity tile — the ANONYMOUS one+    // (pup 4-dot mark in the avatar inset) — so a different-profile window is visibly not-you.+    const _idExtDir = (path.basename(userDataDir || '') === 'adom-you') ? await stageIdentityExtension()+      : ((pupSettings().toolbarExtension !== 'off') ? _stageExtDir('extension-identity-anon', 'pup-identity-anon-extension') : null);     // v2.0.92 (John: pen button beside the extension icons — Chrome allows ONE action per     // extension, so the pen is its own tiny extension; three family tiles = the Adom toolbar)     const _penExtDir = (pupSettings().toolbarExtension !== 'off') ? _stageExtDir('extension-annotate', 'pup-annotate-extension') : null;@@ -11319,7 +11322,7 @@ const server = http.createServer(async (req, res) => {                      hint: m.hint || summary, related: m.related || [], pitfalls: m.pitfalls || [] };           };           sendJSON(res, { success: true, bridge: 'puppeteer', verbs: [-            V('pup_open_window', 'Open a generic pup window — a fresh isolated Chrome/Edge process (never your real signed-in browser), fully drivable via CDP. ALWAYS opens in the BACKGROUND (does not steal focus; never disturbs the user\'s main work; still fully screenshottable/drivable) UNLESS you pass foreground:true — do that ONLY when the user explicitly wants to watch. Pass width+height (+ optional x,y, screen px) to place it at a specific size/position for screenshot framing — this NO LONGER foregrounds it (sizing stays in the background too; default unsized is maximized). profile defaults to the durable shared \'adom-you\' profile (logins/localStorage persist + are shared across all pup windows); isolated:true for a private throwaway. OWNERSHIP: sessionIds are shared across ALL AI threads — use a task-prefixed sessionId + owner:"<your-task>" so pup can refuse other threads stealing your window (reusing an existing id with a new url navigates it away; declared cross-owner reuse errors with session_owned_by_another_thread unless takeover:true). (For the user\'s REAL Chrome/Edge, use the Adom extension\'s nbrowser_* verbs.)', { sessionId: 'optional str — OMIT IT (recommended): your thread gets its OWN window keyed on your --ai-thread name; the first open creates it, later opens become TABS in it, and no other thread can touch it. Pass an explicit id only when you need a SEPARATE window (task-prefix it, e.g. "mytask-web")', url: 'optional str', profile: 'optional str — a named durable jar; DEFAULT is the shared "adom-you" profile (signed-in state shared across windows). isolated:true overrides to a throwaway', isolated: 'optional bool — private throwaway profile: fresh-login tests, acting as a different user', webSecurity: 'optional false — dev escape hatch for cross-origin eval; FORCES isolation so insecure flags never touch the credentialed profile', owner: 'optional str — your thread/task label; lets pup protect this window from other threads', takeover: 'optional bool — claim a window owned by another thread (only when the user explicitly asks)', foreground: 'optional bool — request showing the window on the user\'s screen. GATED (v1.8.70): requires foregroundReason too, else the open succeeds but stays BACKGROUND with foregroundDenied set. Only when the USER explicitly asked to watch.', foregroundReason: 'required WITH foreground:true — quote/paraphrase what the user said that justifies putting a window on their screen (min 10 chars; logged + recorded in lastAgentUpdate, auditable)', width: 'optional int px — sizes for screenshot framing, stays background', height: 'optional int px', x: 'optional int px', y: 'optional int px', wikiView: 'optional "authed"|"public" — for wiki.adom.inc URLs. THREE distinct cases: (1) OMIT = the shared adom-you profile, which is LOGGED IN as the user if they have signed into the wiki (the usual case — one shared login serves every window); this is NOT anonymous. (2) "public" = an ISOLATED anonymous jar, genuinely LOGGED OUT — exactly what the world sees; use this to verify a publish did not leak private source. (3) "authed" = the explicit logged-in vault view (30-day SSO; first use may need a one-time login — response says wikiLoginNeeded). To compare "what I see" vs "what the world sees", open one "authed" (or omit) AND one "public" — do NOT rely on omit for the public view, it shows the logged-in shared profile.', appName: 'optional str — the APP this window is driving (e.g. "shotlog"); shown in the hover tooltip', appIconB64: 'optional base64 PNG — override the app icon worn in the taskbar overlay. Usually UNNECESSARY: pup auto-fetches the page\'s own <link rel="icon"> favicon (the adom-ui-design standard artifact every app must serve) and wears it automatically. An app-looking URL with NO favicon gets a reprimand hint.', updateNote: 'optional str — a short "what I did" note, surfaced back in list_tabs/list_windows as lastAgentUpdate so the user knows what changed', autoFlash: 'optional bool (default true) — mutating verbs auto-flash this window\'s taskbar (debounced, never steals focus) so the user notices the agent touched it; pass false to make this window silent by default', silent: 'optional bool — suppress the auto-flash for just this call' }, 60, { sessionId: 'mytask-web', owner: 'mytask', url: 'https://example.com', width: 960, height: 540 }),+            V('pup_open_window', 'Open a generic pup window — a fresh isolated Chrome/Edge process (never your real signed-in browser), fully drivable via CDP. ALWAYS opens in the BACKGROUND (does not steal focus; never disturbs the user\'s main work; still fully screenshottable/drivable) UNLESS you pass foreground:true — do that ONLY when the user explicitly wants to watch. Pass width+height (+ optional x,y, screen px) to place it at a specific size/position for screenshot framing — this NO LONGER foregrounds it (sizing stays in the background too; default unsized is maximized). profile defaults to the durable shared \'adom-you\' profile (logins/localStorage persist + are shared across all pup windows); isolated:true for a private throwaway. OWNERSHIP: sessionIds are shared across ALL AI threads — use a task-prefixed sessionId + owner:"<your-task>" so pup can refuse other threads stealing your window (reusing an existing id with a new url navigates it away; declared cross-owner reuse errors with session_owned_by_another_thread unless takeover:true). (For the user\'s REAL Chrome/Edge, use the Adom extension\'s nbrowser_* verbs.)', { sessionId: 'optional str — OMIT IT (recommended): your thread gets its OWN window keyed on your --ai-thread name; the first open creates it, later opens become TABS in it, and no other thread can touch it. Pass an explicit id only when you need a SEPARATE window (task-prefix it, e.g. "mytask-web")', url: 'optional str', profile: 'optional str — a named durable jar; DEFAULT is the shared "adom-you" profile (signed-in state shared across windows). isolated:true overrides to a throwaway', isolated: 'optional bool — private throwaway profile: fresh-login tests, acting as a different user. REASON-GATED (v2.0.101): requires isolationReason or the open is refused — every window defaults to the shared adom-you profile', isolationReason: 'required WITH isolated:true — why this window must NOT ride the shared adom-you profile (min 10 chars; logged, auditable). webSecurity:false and wikiView:public carry their own built-in reason', webSecurity: 'optional false — dev escape hatch for cross-origin eval; FORCES isolation so insecure flags never touch the credentialed profile', owner: 'optional str — your thread/task label; lets pup protect this window from other threads', takeover: 'optional bool — claim a window owned by another thread (only when the user explicitly asks)', foreground: 'optional bool — request showing the window on the user\'s screen. GATED (v1.8.70): requires foregroundReason too, else the open succeeds but stays BACKGROUND with foregroundDenied set. Only when the USER explicitly asked to watch.', foregroundReason: 'required WITH foreground:true — quote/paraphrase what the user said that justifies putting a window on their screen (min 10 chars; logged + recorded in lastAgentUpdate, auditable)', width: 'optional int px — sizes for screenshot framing, stays background', height: 'optional int px', x: 'optional int px', y: 'optional int px', wikiView: 'optional "authed"|"public" — for wiki.adom.inc URLs. THREE distinct cases: (1) OMIT = the shared adom-you profile, which is LOGGED IN as the user if they have signed into the wiki (the usual case — one shared login serves every window); this is NOT anonymous. (2) "public" = an ISOLATED anonymous jar, genuinely LOGGED OUT — exactly what the world sees; use this to verify a publish did not leak private source. (3) "authed" = the explicit logged-in vault view (30-day SSO; first use may need a one-time login — response says wikiLoginNeeded). To compare "what I see" vs "what the world sees", open one "authed" (or omit) AND one "public" — do NOT rely on omit for the public view, it shows the logged-in shared profile.', appName: 'optional str — the APP this window is driving (e.g. "shotlog"); shown in the hover tooltip', appIconB64: 'optional base64 PNG — override the app icon worn in the taskbar overlay. Usually UNNECESSARY: pup auto-fetches the page\'s own <link rel="icon"> favicon (the adom-ui-design standard artifact every app must serve) and wears it automatically. An app-looking URL with NO favicon gets a reprimand hint.', updateNote: 'optional str — a short "what I did" note, surfaced back in list_tabs/list_windows as lastAgentUpdate so the user knows what changed', autoFlash: 'optional bool (default true) — mutating verbs auto-flash this window\'s taskbar (debounced, never steals focus) so the user notices the agent touched it; pass false to make this window silent by default', silent: 'optional bool — suppress the auto-flash for just this call' }, 60, { sessionId: 'mytask-web', owner: 'mytask', url: 'https://example.com', width: 960, height: 540 }),             V('pup_open_tab', 'Open a new tab in an EXISTING session/window (returns {tabId, tabCount, activeTabId} — no need to diff list_tabs). This is the right verb for multi-URL work: ONE window with many tabs (one taskbar button), not many windows. The window stays in the background; the tab auto-flashes the taskbar (debounced) so the user notices. The USER can click the window\'s taskbar button at any time to view it — pup never pulls it back down.', { sessionId: 'required str', url: 'optional str', updateNote: 'optional str — short "what I did" note surfaced in list_tabs as lastAgentUpdate', silent: 'optional bool — suppress the auto-flash for this call' }, 30, { sessionId: 'work', url: 'https://example.com' }),             V('pup_close_tab', 'Close a tab.', { sessionId: 'required str', tabId: 'optional str (default active)' }, 15, { sessionId: 'work' }),             V('pup_close_window', 'Close a window/session (its tabs go too).', { sessionId: 'required str' }, 20, { sessionId: 'work' }),@@ -11541,6 +11544,19 @@ const server = http.createServer(async (req, res) => {           if (isAdomUrl(args.url) && !args.wikiView) { args.wikiView = 'authed'; args._wikiDefaultedAuthed = true; }           if (args.wikiView === 'public' && isAdomUrl(args.url)) args.isolated = true;           if (args.isolated === true) {+            // v2.0.101 (John: "ALWAYS open in adom-you for consistency; an alternate profile only+            // when the AI specifically asks AND gives a reason why"). Isolation is REASON-GATED+            // like foregrounding: the two definitional cases carry their own reason, an explicit+            // isolated:true must state one or the open is refused with a teaching hint.+            if (!args.isolationReason) {+              if (args.webSecurity === false) args.isolationReason = 'webSecurity:false — insecure per-process flags must never touch the credentialed adom-you jar';+              else if (args.wikiView === 'public') args.isolationReason = 'wiki public view — a genuinely logged-out jar showing exactly what the world sees';+            }+            if (!args.isolationReason || String(args.isolationReason).trim().length < 10) {+              sendJSON(res, { success: false, error: 'isolation_reason_required', errorCode: 'isolation_reason_required', _hint: 'Every pup window rides the ONE shared adom-you profile by default (consistency + every login enriches the shared credential jar — the user wants this). isolated:true is the exception and needs a stated reason: re-call with isolationReason:"<why this window must NOT be adom-you>" (min 10 chars, e.g. fresh-login test, acting as a different user, untrusted site). If you do not truly need isolation, drop isolated:true.' });+              return;+            }+            console.log(`[profile] "${args.sessionId}" ISOLATED — reason: ${args.isolationReason}`);             args.profile = 'iso-' + args.sessionId;   // isolation beats any explicit profile           } else {             // v1.9.346 (John: "steer everything to adom-you"). adom-you IS the AI doppelganger's identity