[browser] Extract the generic browser-task engine from the apply loop
Factor the job-specific parts out of lib/apply-loop.ts so the pure loop can drive ANY objective, with zero behavior change to job-apply.
Do
- Keep
runApplyLoop / ApplyDeps<J extends BrowserJobBase> as the generic core (it already is).
- Move job-specific pieces behind the
decide dep + a pluggable prompt: applySystemPrompt, decideAction, and the job-only finish outcomes (submitted/ready/expired/blocked). Introduce a generic outcome set (done/blocked/needs_input/failed/...) the apply variant maps onto.
- No new entry points here — apply keeps calling the same code paths.
Acceptance
Part of the browser-generalization epic. Blocks the rest.
[browser] Extract the generic browser-task engine from the apply loop
Factor the job-specific parts out of
lib/apply-loop.tsso the pure loop can drive ANY objective, with zero behavior change to job-apply.Do
runApplyLoop/ApplyDeps<J extends BrowserJobBase>as the generic core (it already is).decidedep + a pluggable prompt:applySystemPrompt,decideAction, and the job-onlyfinishoutcomes (submitted/ready/expired/blocked). Introduce a generic outcome set (done/blocked/needs_input/failed/...) the apply variant maps onto.Acceptance
Part of the browser-generalization epic. Blocks the rest.