• Implements docs/todo/verifier-fan-out-jury-design.md. root_cause_trace.py:
    _tally_perspectives() extracts the existing >=2/3 rule out of
    judge_root_cause so the closure-based version and the new
    judge_root_cause_via_work_graph() share one implementation, not two that
    could drift apart. The fan-in vote stays plain Python (zero_token
    aggregation per the design-dynamic-work-graph Skill's own edge_type
    distinction) rather than becoming a fourth Work Node -- no reason to pay
    for an Agent call just to count votes.
    
    judge_root_cause_via_work_graph(): each perspective becomes an
    independent Work Node with real schema-constrained structured output
    ({"category", "detail"} directly), not real_validator_perspective's
    manual "CATEGORY:"/"DETAIL:" text-line parsing. judge_root_cause /
    real_validator_perspective are kept, not removed -- documented as the
    lightweight fallback for scenarios that don't need worktree/Work Graph
    overhead.
    
    org_level_loop.run_fix_loop (the one real production caller) now calls
    the Work Graph version; the fixer/verify calls are unchanged flat
    trigger_org_node calls.
    
    Real bug found and fixed along the way: this is the first production code
    path that actually triggers a run_graph() multi-node CONCURRENT layer
    (every graph_manifest before F was single-node or a strict serial chain,
    so G's ThreadPoolExecutor path had never really run in production).
    scheduler.py::run_goal_to_completion and
    task_execution.py::start_task_execution_in_background both created their
    conn without check_same_thread=False -- fixed both, since their conn can
    now reach run_graph()'s worker threads via run_fix_loop.
    
    Test boundary migrated in test_org_level_loop.py/test_scheduler.py: the
    3 perspective calls are now mocked at work_graph_execute.write_workflow_script/
    execute_work_graph (matching test_work_graph_orchestrate.py's pattern)
    instead of org_node_trigger.trigger_org_node. New tests cover: three real
    independent Work Node executions, judgment-rule equivalence with the
    closure version, clean per-node input_payload, and concurrent wall-clock
    overlap across the three perspectives.
    
    Full src suite (586 tests) + supervisor suite (125 tests) pass with zero
    regressions.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »

  • run_fix_loop() chains U-015 (3-perspective root-cause judgment) + U-016
    (routing) + real Coder/Planner/Validator calls into architecture doc §11's
    4th MVP acceptance criterion: judge -> create bug_record -> route
    (fast_lane for category=coder, full_replan for category=planning -- a
    fixed mapping this Unit defines, since bug_record.suggested_route is
    technically an independent Validator judgment but REQ-05/architecture §11's
    scenarios always correlate the two, so no extra Agent call was added just
    to re-decide it) -> trigger the fixer -> re-trigger Validator -> close_task_
    done on confirmed PASS.
    
    3 new mocked stdlib unittest cases (route branching, verification-fails
    leaves the task out of 'done'). 160 total mocked tests across U-001-017,
    all passing.
    
    Real coverage reuses U-015's wall-collision scenario but this time drives
    an actual fix: a real Coder call edits collision.py in the repo, a real
    Validator call reads the fixed file and confirms it, running as a detached
    background process (survives this session's own restarts, unlike two
    earlier real runs this session that got silently orphaned by a session
    teardown with no completion record -- lesson learned, not repeated).
    
    This closes PH2-S1 (U-015/016/017): REQ-04/05/09 and architecture doc §11
    criterion 4 are now real, verified code, not just planned intent.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »