You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(miner): build the autonomous supervising loop
Closes#5135
The final piece of Wave 3.5's Miner AMS epic (#5130): a real
discover -> claim -> attempt -> observe -> re-enter loop, composing
every existing primitive (runDiscover, runAttempt, the run-loop
boundary gate, loop-reentry, loop-closure) into an actual repeat-
until-halted CLI command. No daemon/watch pattern existed anywhere in
this package before this change.
New pieces:
- lib/loop-cli.js: `gittensory-miner loop` -- fails closed if governor
state can't be loaded; checks the kill switch and a real per-repo
policy-aware run-loop boundary gate before every claim; runs a real
attempt via runAttempt's onResult hook; on a submitted outcome,
polls the real PR disposition and records it; tracks real in-memory
convergence history and persists real GovernorCapUsage (turnsTaken
from runMinerAttempt's own totalTurnsUsed, elapsedMs from wall-clock)
via governor-state.js's saveCapUsage -- previously uncalled anywhere.
A permanent AI-usage-policy block marks its item done instead of
requeuing it forever; any other non-submitted outcome requeues, and
a genuinely stuck item halts the whole run via real non-convergence
detection rather than looping forever.
- lib/pr-disposition-poller.js: polls a PR's real merge/close
disposition (distinct from ci-poller.js's check-run polling) and
classifies it into loop-reentry's merged/disengaged/other vocabulary
-- the missing piece pr-outcome.js's store had no real caller for.
- attempt-cli.js: surfaces runMinerAttempt's real loopResult turn
usage (totalTurnsUsed/iterationsUsed) through options.onResult, so
the loop can save genuine cap usage instead of a fabricated number.
Documented, deliberate gaps (not silently papered over): convergence
and cap-usage history are scoped to this loop process's own lifetime
(cap usage itself persists across restarts; per-issue convergence
counters do not -- a durable version needs attempt-log.js to grow a
repo+issue index, a separate schema change); the loop's kill-switch
and boundary checks are global-scope only, matching runAttempt's own
existing gap (a per-repo `.gittensory-miner.yml` pause resolver now
exists via #5255 but isn't wired into either call site yet).
0 commit comments