mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:32:32 +00:00
3.7 KiB
3.7 KiB
Auto QA Orchestration
Overview
- Auto Drive now runs the coordinator and observer threads in parallel.
- The coordinator handles CLI execution and agent planning.
- QA orchestration owns review cadence, observer bootstrap, and the forced cross-check before completion.
Observer Lifecycle
- Bootstrap – The ChatWidget starts the observer worker and sends a
bootstrap prompt. The observer performs a read-only scan, records a
baseline summary, and emits
AppEvent::AutoObserverReady. Cadence triggers remain paused until this event arrives. - Delta ingestion – After bootstrap only new user and assistant
turns (no reasoning) are forwarded. ChatWidget tracks
observer_history.last_sent_indexso the observer never replays the full transcript. - Thinking stream – During bootstrap, cadence, and cross-check
prompts the observer streams reasoning via
AppEvent::AutoObserverThinking. ChatWidget stores each frame inObserverHistoryand labels it in the Auto Threads overlay (Bootstrap / Observer / Cross-check thinking). - Cadence checks – On the configured cadence the observer reviews the latest delta. Failures push banners such as “Observer guidance: …” and can replace the CLI prompt; successes only update telemetry.
- Cross-check reuse – When the coordinator reports
finish_success, it slices the observer transcript starting atobserver_history.bootstrap_lenand issuesBeginCrossCheck. The observer reuses that slice, runs with a stricter tool policy, and only if the cross-check passes does the coordinator forward the pending decision. Failures convert to a restart banner and abort completion.
Tool Policies by Mode
- Bootstrap (
ObserverMode::Bootstrap) – Read-only tools (web search only) so the observer can assess the repository without modifying files. - Cadence (
ObserverMode::Cadence) – Limited tools (web search) for light guidance while the run is in flight. - Cross-check (
ObserverMode::CrossCheck) – Full audit tools (local shell plus web search) so the observer can rerun commands and verify results before finish.
UI and History
ObserverHistorypersists observer exchanges and reasoning frames. Auto Threads overlay entries now include the observer mode in their label.- Banners surface milestones: “Observer bootstrap completed.”, “Cross-check in progress.”, “Cross-check successful.” Failures include guidance text or restart notices.
Teardown and Restart
auto_stopand automatic restarts clearObserverHistory, reset the readiness flag, and sendResetObserverso the coordinator rebuilds state before the next run.- The QA orchestrator handle is stopped alongside the observer. All cadence and cross-check state is reconstructed on the next launch.
QA Orchestrator Responsibilities
- Emit
AppEvent::AutoQaUpdate { note }every cadence window (default three turns). - Emit
AppEvent::AutoReviewRequest { summary }when diff-bearing turns satisfy the review cooldown. These events are now the sole trigger for automated reviews. - Reset cadence state on shutdown and send a final review request if diffs remain when automation stops.
Environment Knobs
CODE_QA_CADENCE— number of turns between observer cadence updates (default three).CODE_QA_REVIEW_COOLDOWN_TURNS— diff-bearing turns beforeAutoReviewRequestfires (default one).- (Future) expose tool-policy overrides if operators need to restrict cross-check access.
Future Work
- Collapse multiple QA toggles into a single
qa_automation_enabledflag inAutoDriveSettings. - Expand observer regression coverage when the VT100 harness exposes observer fixtures (TODO).