loopx icon indicating copy to clipboard operation
loopx copied to clipboard

feat(auto-research): add worker-loop control transitions (stop, state…

Open rootkiller6788 opened this issue 4 months ago • 1 comments

…-aware wake, quota-pause)

Extends the auto-research worker-loop lifecycle with three explicit control transitions, allowing operators to pause, selectively wake, and take over long-running research loops without process termination or quota exhaustion.

External stop signal (worker_loop.py)

Check workspace/.loopx-auto-research-stop before each round. When present, exit with stop_reason = operator_stop_requested. Individual worker-turn calls are not gated, preserving the takeover path.

State-aware visible wake (demo_e2e.py)

Filter lanes by frontier state (load_auto_research_worker_frontier) before broadcasting the post-launch wake. Skip lanes at quiet_completion, with no selected todo, or blocked by quota. Filtered lanes recorded under state_aware_filter for auditability.

Quota-aware pause (worker_runtime.py)

Return mode = paused_by_quota when quota.ok && !quota.should_run, before execution but after todo selection. Worker-loop distinguishes quota_paused from no_executed_turns.

Takeover walkthrough smoke (new)

examples/auto-research-stop-takeover-walkthrough-smoke.py — synthetic data smoke proving the complete cycle: seed → loop → stop → operator takeover (single-lane worker-turn + hand-crafted successor) → resume. No live model, no credentials, no private paths.

GH-C43

Summary

-

Issue Or Task

  • Closes #
  • Contributor task ID:

Validation

  • [ ] python3 -m py_compile loopx/*.py
  • [ ] loopx check --scan-root .
  • [ ] Other:

Boundary Checklist

  • [ ] I did not commit .loopx/, .codex/goals/, live ACTIVE_GOAL_STATE.md, credentials, private benchmark traces, verifier output, raw agent sessions, internal document links, or local machine paths.
  • [ ] I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.
  • [ ] I kept the change scoped to the linked issue/task.

rootkiller6788 avatar Aug 05 '26 11:08 rootkiller6788

Thanks for the detailed review.

Addressed the requested changes:

Fixed

1. Empty ready lane wake behavior

  • ready_lanes=[] no longer calls the legacy wake callback.
  • Added explicit no_op_all_filtered receipt with regression coverage.

2. Public boundary hardening

  • Removed raw exception strings from frontier filtering output.
  • Replaced raw exception exposure with stable public error codes.

3. Focused lifecycle regression tests

Replaced the 521-line walkthrough smoke with three focused lifecycle tests:

  • stop marker lifecycle
  • quota pause semantics
  • state-aware wake filtering

Verification

All lifecycle checks pass:

  • stop marker halts before round one
  • stop marker checked before each round
  • paused_by_quota distinct from no_executed_turns
  • empty ready_lanes produces no-op receipt
  • frontier failure output is public-safe
  • state-aware wake filtering is covered

Requesting re-review.

rootkiller6788 avatar Aug 06 '26 05:08 rootkiller6788