Commit Graph

6 Commits

Author SHA1 Message Date
type-two
18790a7e4e fix(flowext): loopback-only queue server, real self-heal, per-machine browser
Three bugs, all found standing up a second rig on m3ultra:

1. SECURITY: HTTPServer(("", 8017)) bound 0.0.0.0 with no auth, and POST /save
   base64-writes bytes to an absolute `dest` taken straight from the request body.
   Anyone on the same wifi could write arbitrary files as this user — drop a
   ~/Library/LaunchAgents plist and you have code execution. It was live on ultra
   (verified: `TCP *:8017 (LISTEN)`, 204 from 192.168.1.249). Now binds 127.0.0.1;
   FLOW_BIND overrides for a tailnet IP (utun-routed, LAN still can't reach it).

2. The launchd "self-heal" never healed anything. launch.sh backgrounds the queue
   server and exits; without AbandonProcessGroup launchd SIGKILLs the process group
   on exit, so every 10-min tick started a server that died a second later. The
   server that was actually up had been started by a manual ./launch.sh.
   Verified after the fix: kill -> 000 -> kickstart -> 204 on a fresh pid.

3. launch.sh hard-coded "Brave Browser" in the osascript. The extension is loaded
   into Chrome on m3ultra. FLOW_BROWSER now names it (default Brave, unchanged
   for ultra); m3ultra's plist sets "Google Chrome".

Also chmod +x install.sh launch.sh (both had lost the bit).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 20:29:53 +10:00
type-two
84fa103125 docs: correct 3cff97d — the 'ratelimited' bug was not real
I claimed done_ids() was binning rate-limited tasks forever. It wasn't:
/task-completed has always refused to persist 'ratelimited' and 'requeue'
rows (they stay PENDING by design), so such an id can never reach
results.jsonl. Verified against the copy that was actually running.

The done_ids() guard stays as defence in depth against a hand-appended row,
but its comment no longer claims to fix a bug that didn't exist. The real
bug in that commit — no circuit breaker on a failure streak — stands, as
does the actual root cause in 82d5ff4 (promptEchoed matched a 60-char prefix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 19:09:22 +10:00
type-two
3cff97df93 fix: circuit-breaker on failure streaks; stop binning rate-limited tasks
Two bugs, both found by autopsy of the djsim_phonewall run (2026-07-08):
15 calendar prompts queued, 2 generated, then THIRTEEN consecutive
"Timed out — no new asset" at a metronomic 3m30s apart. 45 minutes of the
driver politely feeding prompts into a Flow that had stopped generating.

1. NO CIRCUIT BREAKER. Each timeout threw, was reported failed, and the
   loop moved straight on. When Flow goes quiet it does not spontaneously
   start again. Now: 3 consecutive failures -> clear isRunning, log a loud
   system message, leave the queue intact for a hand-resume. (The abuse-flag
   path already had consecutiveRateLimits; failures had nothing.)

2. done_ids() COUNTED 'ratelimited' AS DONE. handleRateLimit() writes that
   status with the explicit comment "report the task back as pending" — and
   the server then binned the task forever. Now excluded. 'failed' is still
   counted: a timeout may have burned credits invisibly, so nothing retries
   automatically.

requeue.py: the deliberate way to retry. --list / --dry / by id or prefix /
--failed. Writes a .bak, never re-runs a success. Used it to make the 13
cal79 prompts pending again.

Note for whoever reads this next: the LIVE server + queue live in
~/Library/Application Support/flowrinse/, not this repo. HERE is derived
from the script's own dir, so running the repo copy silently serves the
stale Jul-6 queue. Copy the script over, run it from there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 18:57:56 +10:00
type-two
c21ea2b22d feat: bake in the by-hand reliability ritual — agent-ready wait, stop-square verify, hard-refresh requeue
- waitForAgentReady: after (re)load, wait for the sidebar to hydrate before typing
- post-submit success check = square stop button (or emptied box); no square after
  Enter + submit fallback -> hard refresh (bypassCache via background) and requeue
- 'Something went wrong' surviving Try-again -> hard refresh + requeue (was: fail)
- requeue attempts capped at 3 per task (chrome.storage, survives reloads)
- server: 'requeue' status keeps task pending; INFLIGHT entries expire after 15 min
  so a reloaded tab gets its task re-served
- banks/djsim_batch3.jsonl: 18-task 90sDJsim asset bank (queued live)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 17:42:15 +10:00
type-two
501431bf59 Flow rinse: browser downloads, fast-fail, autoStart, launcher + self-healing launchd
- background.js: chrome.downloads via page session (no CSP/base64)
- content.js: fast-fail on Flow error banner, image vs video timeouts, autoStart
- local_server_example.py: /enqueue + /save, downloads/ output, resume-skip
- launch.sh: idempotent server-up + caffeinate + single-tab focus
- install.sh + plist: self-healing agent every 10 min (TCC-safe App Support copy)
- flowclient.py: enqueue/wait_for helper for game projects
- README: full setup + macOS TCC gotcha

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-06 01:20:32 +10:00
type-two
7ae0a73db0 Flow Auto-Pilot: trusted-CDP input driver, local queue server, 91-prompt bank
DOM automation for Google Labs Flow — background worker injects trusted input
via the DevTools Protocol (Flow's editor ignores synthetic events), polls a local
queue, harvests generated asset URLs. Includes the generated game+promo prompt bank.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-05 22:44:10 +10:00