• judge_root_cause(): runs 3 perspective_fns (correctness/requirement-
    completeness/skill-defect, 04-P §4.3), requires >=2/3 agreement on a
    category or raises InconclusiveEscalateError with all raw judgments
    attached (REQ-04's failure case). trace_root_cause_test_failed() creates a
    brand-new bug_record on agreement; trace_root_cause_human_reported()
    field-completes an existing one instead (04-P's explicit distinction
    between the two origins, not a new record either way).
    
    c_bug_record_create (bug_record.py): validates root_cause_category against
    {planning, coder, skill_defect} -- core_engine deliberately excluded,
    matching U-001's schema CHECK constraint (PH5/U-034 scope). Known,
    deliberately-unenforced gap noted rather than guessed at: 03-C §3.10's
    "skill_defect requires creating a skill_iteration_suggestion" constraint
    can't be satisfied yet (skill_iteration.before/after_git_commit_sha are
    NOT NULL but don't exist until a real skill rewrite happens in U-018) --
    REQ-04's three cases never exercise skill_defect, so nothing here needs it
    resolved yet.
    
    real_validator_perspective() builds a real claude --agent validator call
    framed from one of the three perspectives, parsing a CATEGORY:/DETAIL:
    response format.
    
    Also fixes a real diagnostic bug found investigating an unrelated failure:
    org_node_trigger.py/work_graph_plan.py/work_graph_execute.py's nonzero-exit
    error paths only included stderr in the raised exception, silently
    dropping stdout -- which is where a real `claude` failure's actual detail
    often lives. A real Coder call failed with exit 1 and empty stderr,
    giving zero diagnostic signal; fixed to include both streams (truncated).
    
    18 new mocked stdlib unittest cases + 1 gated real test (3 real Validator
    perspective calls judging a deliberately-injected wall-collision bug,
    expecting agreement on root_cause_category=coder). 146 total mocked tests
    across U-001-015, all passing.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »
  • trigger_org_node(org_node, prompt, target_folder_path): shells out
    `claude --agent <org_node> -p ... --permission-mode auto` with cwd=target
    project, parses the JSON result, raises OrgNodeTriggerError on nonzero exit
    or is_error. Skeleton only, per development-plan.md ("不含完整状态机") --
    TASK_NOT_READY/CONCURRENCY_LIMIT_REACHED/USAGE_LIMIT_REACHED handling is
    U-010's job.
    
    Also refactors test_agent_e2e.py (U-004) to call this real function instead
    of its own ad-hoc subprocess invocation, so the gated real-agent test now
    exercises U-005's actual production code path -- confirmed still passing
    against a real `claude --agent planner` call.
    
    5 new mocked stdlib unittest cases (CLAUDE.md Testing constraint: mock the
    subprocess boundary in normal tests). 46 total across U-001-005, all
    passing; the 1 gated real-agent test re-verified manually.
    
    Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
    bboonnee authored
     
    Browse File »