Skip to content

Commit 11b2d77

Browse files
author
SIN-Agent
committed
docs: doctor-audit — auto-fix
1 parent 34554db commit 11b2d77

140 files changed

Lines changed: 3274 additions & 2520 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
## Summary
2+
23
- What changed?
34
- Why?
45

56
## Boundary Check
67

78
### Surface type
9+
810
- [ ] Official documentation
911
- [ ] Runtime/product/ops implementation claim
1012
- [ ] Org registry/overview claim
1113

1214
### Verification
15+
1316
- [ ] This PR keeps ownership scoped to docs canon
1417
- [ ] This PR does not overclaim implementation ownership
1518
- [ ] This PR does not replace org overview as registry layer

.opencode/KNOWLEDGE_CHROME_LOGIN_FLOW.md

Lines changed: 77 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -66,60 +66,67 @@ When starting Chrome for login automation, these flags are **REQUIRED**:
6666

6767
### Flag Explanations:
6868

69-
| Flag | Why MANDATORY |
70-
|------|---------------|
71-
| `--user-data-dir=<path>` | Isolates Chrome profile from user's real profile |
72-
| `--remote-debugging-port=<port>` | Enables CDP connection for nodriver/automation |
69+
| Flag | Why MANDATORY |
70+
| --------------------------------------- | ------------------------------------------------------------------------------------ |
71+
| `--user-data-dir=<path>` | Isolates Chrome profile from user's real profile |
72+
| `--remote-debugging-port=<port>` | Enables CDP connection for nodriver/automation |
7373
| `--disable-search-engine-choice-screen` | **CRITICAL:** Prevents EU search engine chooser popup that blocks ALL keyboard input |
74-
| `--no-default-browser-check` | Prevents "set as default browser" dialog |
75-
| `--no-first-run` | Skips first-run welcome page |
76-
| `--disable-popup-blocking` | Allows login popups to open |
74+
| `--no-default-browser-check` | Prevents "set as default browser" dialog |
75+
| `--no-first-run` | Skips first-run welcome page |
76+
| `--disable-popup-blocking` | Allows login popups to open |
7777

7878
### Ports by System:
7979

80-
| System | Port |
81-
|--------|------|
82-
| antigravity-rotator | 7654 |
80+
| System | Port |
81+
| ---------------------------------- | ---- |
82+
| antigravity-rotator | 7654 |
8383
| openai-google-rotator (standalone) | 9336 |
84-
| webauto-nodriver-mcp | 9335 |
84+
| skylight-cli-mcp | 9335 |
8585

8686
---
8787

8888
## 4. BLOCKER #1: EU Search Engine Choice Popup
8989

9090
### What Happens:
91+
9192
When Chrome starts with a **completely fresh profile** (no prior usage), the EU-mandated
9293
"Wähle deine Suchmaschine" (Choose your search engine) dialog appears BEFORE anything else.
9394

9495
### Why It Blocks:
96+
9597
- Renders as a Chrome-native overlay (NOT a webpage — no DOM to manipulate)
9698
- Intercepts ALL keyboard input (Tab, Space, Enter do nothing useful)
9799
- Prevents the profile menu from being accessed
98100
- Cannot be dismissed via JavaScript or CDP commands
99101

100102
### Solution:
103+
101104
```bash
102105
--disable-search-engine-choice-screen
103106
```
107+
104108
This flag MUST be present when launching Chrome. Without it, the entire login flow is dead.
105109

106110
---
107111

108112
## 5. BLOCKER #2: Google Cookie Consent Popup
109113

110114
### What Happens:
115+
111116
Even after bypassing the search engine popup, if Chrome navigates to google.com,
112117
Google shows a "Bevor Sie zu Google weitergehen" (Before you continue to Google)
113118
cookie consent overlay.
114119

115120
### Why It Blocks:
121+
116122
- The overlay covers the entire page
117123
- The profile dropdown menu opens BEHIND the overlay
118124
- Clicking the profile icon works, but the dropdown is not interactable
119125

120126
### Solutions (in order of preference):
121127

122128
**Solution A: Navigate to a non-Google page first (RECOMMENDED)**
129+
123130
```bash
124131
# Start Chrome with about:blank or chrome://newtab instead of google.com
125132
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
@@ -129,9 +136,11 @@ cookie consent overlay.
129136
--no-first-run \
130137
"about:blank"
131138
```
139+
132140
Then do the 5-step profile flow on the blank page — no cookie consent appears!
133141

134142
**Solution B: Accept cookies first via keyboard**
143+
135144
```applescript
136145
-- Navigate to google.com, then:
137146
-- Tab multiple times to reach "Alle akzeptieren" button
@@ -140,9 +149,11 @@ Then do the 5-step profile flow on the blank page — no cookie consent appears!
140149
```
141150

142151
**Solution C: Additional Chrome flags**
152+
143153
```bash
144154
--disable-features=PrivacySandboxSettings4
145155
```
156+
146157
Note: This may not fully suppress the consent popup in all Chrome versions.
147158

148159
---
@@ -164,45 +175,45 @@ tell application "System Events"
164175
-- Step 1: Focus URL address bar (Cmd+L)
165176
keystroke "l" using command down
166177
delay 0.5
167-
178+
168179
-- Step 2: Tab to profile icon in toolbar
169180
-- NOTE: Exact tab count depends on Chrome UI elements (extensions, etc.)
170181
-- For a clean profile with no extensions: 1x Tab = profile icon
171182
key code 48 -- Tab
172183
delay 0.5
173-
184+
174185
-- Step 3: Space to open profile dropdown
175186
keystroke " "
176187
delay 1.5 -- Need longer delay for dropdown animation
177-
188+
178189
-- Step 4: Tab to "Anmelden" / "Sign in" button in dropdown
179190
key code 48 -- Tab
180191
delay 0.5
181-
192+
182193
-- Step 5: Space to click sign in button
183194
keystroke " "
184195
delay 3.0 -- Wait for Google login page to load
185-
196+
186197
-- ============================================================
187198
-- NOW IN GOOGLE LOGIN POPUP/TAB
188199
-- ============================================================
189-
200+
190201
-- Step 6: Type email address
191202
keystroke "your-email@domain.com"
192203
delay 0.5
193-
204+
194205
-- Step 7: Press Enter to submit email
195206
key code 36 -- Enter/Return
196207
delay 3.0 -- Wait for password page
197-
208+
198209
-- Step 8: Type password
199210
keystroke "YourPassword123"
200211
delay 0.5
201-
212+
202213
-- Step 9: Press Enter to submit password
203214
key code 36 -- Enter/Return
204215
delay 3.0 -- Wait for login to complete
205-
216+
206217
-- Step 10: Handle "Sync aktivieren?" dialog if it appears
207218
-- Tab to "Ja, bitte" or "Yes, I'm in" button and press Enter
208219
key code 48 -- Tab
@@ -215,15 +226,15 @@ end tell
215226

216227
## 7. APPLESCRIPT KEY CODES REFERENCE
217228

218-
| Key | Code | Method |
219-
|-----|------|--------|
220-
| Tab | `key code 48` | `key code 48` |
221-
| Enter/Return | `key code 36` | `key code 36` |
222-
| Escape | `key code 53` | `key code 53` |
223-
| Space | N/A | `keystroke " "` |
224-
| Cmd+L (address bar) | N/A | `keystroke "l" using command down` |
225-
| F6 (toolbar focus) | `key code 97` | `key code 97` (CAUTION: may focus wrong app like Docker) |
226-
| Shift+Tab (reverse tab) | `key code 48 using shift down` | Goes LEFT from address bar — NOT to profile icon |
229+
| Key | Code | Method |
230+
| ----------------------- | ------------------------------ | -------------------------------------------------------- |
231+
| Tab | `key code 48` | `key code 48` |
232+
| Enter/Return | `key code 36` | `key code 36` |
233+
| Escape | `key code 53` | `key code 53` |
234+
| Space | N/A | `keystroke " "` |
235+
| Cmd+L (address bar) | N/A | `keystroke "l" using command down` |
236+
| F6 (toolbar focus) | `key code 97` | `key code 97` (CAUTION: may focus wrong app like Docker) |
237+
| Shift+Tab (reverse tab) | `key code 48 using shift down` | Goes LEFT from address bar — NOT to profile icon |
227238

228239
---
229240

@@ -234,14 +245,15 @@ end tell
234245
The number of Tab presses from the address bar to the profile icon depends on
235246
what Chrome UI elements are visible:
236247

237-
| Chrome State | Tab Count to Profile Icon |
238-
|-------------|---------------------------|
239-
| Clean profile, no extensions | 1 Tab |
240-
| With "KI-Modus" button visible | 2-3 Tabs |
241-
| With extensions installed | Variable (count visible icons + 1) |
242-
| With bookmarks bar visible | May need more tabs |
248+
| Chrome State | Tab Count to Profile Icon |
249+
| ------------------------------ | ---------------------------------- |
250+
| Clean profile, no extensions | 1 Tab |
251+
| With "KI-Modus" button visible | 2-3 Tabs |
252+
| With extensions installed | Variable (count visible icons + 1) |
253+
| With bookmarks bar visible | May need more tabs |
243254

244255
### Important:
256+
245257
- `Shift+Tab` from address bar goes LEFT (to back/forward buttons) — NOT to profile icon
246258
- `F6` (key code 97) sometimes jumps to toolbar but can focus wrong application (Docker, etc.)
247259
- **ALWAYS use `Cmd+L``Tab` pattern** — most reliable
@@ -251,18 +263,21 @@ what Chrome UI elements are visible:
251263
## 9. NODRIVER CDP CONNECTION (NOT uc.start())
252264

253265
### WRONG (starts NEW Chrome, port conflict):
266+
254267
```python
255268
browser = await uc.start(headless=False, user_data_dir=..., browser_args=[...])
256269
```
257270

258271
### CORRECT (connects to EXISTING Chrome):
272+
259273
```python
260274
import nodriver as uc
261275
browser = await uc.start(host="127.0.0.1", port=7654)
262276
# This connects to the Chrome instance already running on port 7654
263277
```
264278

265279
### Why This Matters:
280+
266281
- The Chrome instance is already running (started by the rotator or manually)
267282
- `uc.start()` with `user_data_dir` starts a SECOND Chrome on a RANDOM port
268283
- This creates port conflicts and the automation talks to the wrong browser
@@ -272,42 +287,47 @@ browser = await uc.start(host="127.0.0.1", port=7654)
272287

273288
## 10. WORKSPACE ACCOUNT DETAILS
274289

275-
| Field | Value |
276-
|-------|-------|
277-
| Domain | `zukunftsorientierte-energie.de` |
278-
| Password | `ZOE.jerry2024` (fallback: `ZOE.jerry2025`) |
279-
| Admin Email | `info@zukunftsorientierte-energie.de` |
280-
| Account Format | `rotator-XXXXXXXXXX@zukunftsorientierte-energie.de` |
281-
| Account Creation | Via Google Admin API or Admin Console |
290+
| Field | Value |
291+
| ---------------------- | ----------------------------------------------------- |
292+
| Domain | `zukunftsorientierte-energie.de` |
293+
| Password | `ZOE.jerry2024` (fallback: `ZOE.jerry2025`) |
294+
| Admin Email | `info@zukunftsorientierte-energie.de` |
295+
| Account Format | `rotator-XXXXXXXXXX@zukunftsorientierte-energie.de` |
296+
| Account Creation | Via Google Admin API or Admin Console |
282297
| Rate Limit on Creation | Google blocks after ~5 accounts (412 abuse detection) |
283-
| Recovery | Restore from trash (771 deleted accounts available) |
298+
| Recovery | Restore from trash (771 deleted accounts available) |
284299

285300
---
286301

287302
## 11. KNOWN ISSUES & EDGE CASES
288303

289304
### Issue: Profile dropdown shows "Anmelden" vs "Sync aktivieren"
305+
290306
- **Fresh profile (never signed in):** Shows "Anmelden" (Sign in)
291307
- **Previously signed in then signed out:** Shows "Sync aktivieren" (Turn on sync)
292308
- **Currently signed in:** Shows account name/avatar
293309
- The Tab+Space flow works the same for both "Anmelden" and "Sync aktivieren"
294310

295311
### Issue: Multiple Chrome windows
312+
296313
- AppleScript `tell application "Google Chrome" to activate` activates the LAST focused window
297314
- If multiple windows exist, use `tell window 1` to target the correct one
298315
- The profile icon is in EACH window's toolbar independently
299316

300317
### Issue: Google 2-Step Verification
318+
301319
- Some accounts may have 2FA enabled
302320
- The rotator accounts should NOT have 2FA (Workspace admin can disable it)
303321
- If 2FA appears: the flow needs additional steps (phone verification, etc.)
304322

305323
### Issue: "Abgemeldet" Account Chooser
324+
306325
- If Google shows an account chooser with previously logged-in accounts
307326
- Click "Anderes Konto verwenden" (Use another account) BEFORE entering email
308327
- Can be handled via additional Tab+Enter sequence
309328

310329
### Issue: Chrome "Profil anpassen" (Customize Profile) Dialog
330+
311331
- May appear after first login asking to customize the profile
312332
- Dismiss with Escape or Tab+Enter on "Überspringen" (Skip)
313333

@@ -322,55 +342,55 @@ import time
322342
def chrome_native_login(email: str, password: str, chrome_port: int = 7654) -> bool:
323343
"""
324344
Log into Google using Chrome's native profile menu (5-step keyboard flow).
325-
345+
326346
PREREQUISITES:
327347
- Chrome must be running with --disable-search-engine-choice-screen
328348
- Chrome must be on about:blank or non-Google page (avoid cookie consent)
329349
- Chrome must have --remote-debugging-port=<chrome_port>
330-
350+
331351
Args:
332352
email: Google account email address
333353
password: Account password
334354
chrome_port: CDP port Chrome is running on
335-
355+
336356
Returns:
337357
True if login appeared to succeed, False otherwise
338358
"""
339-
359+
340360
# === STEP 0: Activate Chrome ===
341361
subprocess.run([
342362
'osascript', '-e',
343363
'tell application "Google Chrome" to activate'
344364
], check=True)
345365
time.sleep(1.0)
346-
366+
347367
# === STEPS 1-5: Open profile menu and click "Sign in" ===
348368
applescript_profile_flow = '''
349369
tell application "System Events"
350370
-- Step 1: Focus URL bar
351371
keystroke "l" using command down
352372
delay 0.5
353-
373+
354374
-- Step 2: Tab to profile icon
355375
key code 48
356376
delay 0.5
357-
377+
358378
-- Step 3: Space to open dropdown
359379
keystroke " "
360380
delay 1.5
361-
381+
362382
-- Step 4: Tab to sign in button
363383
key code 48
364384
delay 0.5
365-
385+
366386
-- Step 5: Space to click sign in
367387
keystroke " "
368388
delay 3.0
369389
end tell
370390
'''
371391
subprocess.run(['osascript', '-e', applescript_profile_flow], check=True)
372392
time.sleep(2.0)
373-
393+
374394
# === STEPS 6-7: Enter email ===
375395
applescript_email = f'''
376396
tell application "System Events"
@@ -382,7 +402,7 @@ def chrome_native_login(email: str, password: str, chrome_port: int = 7654) -> b
382402
'''
383403
subprocess.run(['osascript', '-e', applescript_email], check=True)
384404
time.sleep(2.0)
385-
405+
386406
# === STEPS 8-9: Enter password ===
387407
applescript_password = f'''
388408
tell application "System Events"
@@ -394,7 +414,7 @@ def chrome_native_login(email: str, password: str, chrome_port: int = 7654) -> b
394414
'''
395415
subprocess.run(['osascript', '-e', applescript_password], check=True)
396416
time.sleep(2.0)
397-
417+
398418
# === STEP 10: Handle sync dialog ===
399419
applescript_sync = '''
400420
tell application "System Events"
@@ -405,7 +425,7 @@ def chrome_native_login(email: str, password: str, chrome_port: int = 7654) -> b
405425
end tell
406426
'''
407427
subprocess.run(['osascript', '-e', applescript_sync], check=True)
408-
428+
409429
return True
410430
```
411431

0 commit comments

Comments
 (0)