@@ -619,9 +619,11 @@ def test_doctor_checks_codex_inbox_when_selected(tmp_target: Path, capsys):
619619 # or on check ordering, which the managed-tool additions can shift.
620620 doctor_mod .run (tmp_target , json_output = True )
621621 payload = json .loads (capsys .readouterr ().out )
622- inbox_checks = {check ["name" ]: check for check in payload ["checks" ] if check ["name" ].startswith ("handoff: codex" )}
623- assert "handoff: codex inbox" in inbox_checks
624- codex_inbox = inbox_checks ["handoff: codex inbox" ]
622+ inbox_checks = {
623+ check ["name" ]: check for check in payload ["checks" ] if check ["name" ].startswith ("adapter: handoff: codex" )
624+ }
625+ assert "adapter: handoff: codex inbox" in inbox_checks
626+ codex_inbox = inbox_checks ["adapter: handoff: codex inbox" ]
625627 assert codex_inbox ["status" ] == doctor_mod .OK
626628 assert ".codex/memory-handoffs" in codex_inbox ["detail" ]
627629
@@ -641,10 +643,10 @@ def test_doctor_reports_default_wired_skills_for_selected_harnesses(tmp_target:
641643 checks = {item ["name" ]: item for item in payload ["checks" ]}
642644
643645 assert rc == 0
644- assert checks ["skills: claude default wired" ]["status" ] == "OK"
645- assert "brigade-work" in checks ["skills: claude default wired" ]["detail" ]
646- assert checks ["skills: codex default wired" ]["status" ] == "OK"
647- assert ".codex/skills" in checks ["skills: codex default wired" ]["detail" ]
646+ assert checks ["adapter: skills: claude default wired" ]["status" ] == "OK"
647+ assert "brigade-work" in checks ["adapter: skills: claude default wired" ]["detail" ]
648+ assert checks ["adapter: skills: codex default wired" ]["status" ] == "OK"
649+ assert ".codex/skills" in checks ["adapter: skills: codex default wired" ]["detail" ]
648650
649651
650652def test_doctor_warns_when_default_wired_skill_is_missing (tmp_target : Path , capsys ):
@@ -661,7 +663,7 @@ def test_doctor_warns_when_default_wired_skill_is_missing(tmp_target: Path, caps
661663 rc = doctor_mod .run (tmp_target , json_output = True )
662664 payload = json .loads (capsys .readouterr ().out )
663665 checks = {item ["name" ]: item for item in payload ["checks" ]}
664- skill_check = checks ["skills: codex default wired: ultra-work-scout" ]
666+ skill_check = checks ["adapter: skills: codex default wired: ultra-work-scout" ]
665667
666668 assert rc == 0
667669 assert skill_check ["status" ] == "WARN"
@@ -713,6 +715,72 @@ def test_doctor_falls_back_to_v0_2_behavior_when_no_config(tmp_target: Path, cap
713715 assert "doctor" in out
714716
715717
718+ def test_build_context_unspecified_harness_without_config (tmp_target : Path , capsys ):
719+ """Unconfigured targets must not inherit Claude harness checks by default."""
720+ tmp_target .mkdir ()
721+ (tmp_target / "AGENTS.md" ).write_text ("# Agents" )
722+
723+ ctx = doctor_mod .build_context (tmp_target )
724+ assert ctx .harnesses == []
725+ assert ctx .selection is None
726+
727+ doctor_mod .run (target = tmp_target , harness = "generic" , json_output = True )
728+ payload = json .loads (capsys .readouterr ().out )
729+ assert payload ["harnesses" ] == []
730+
731+ names = {check ["name" ] for check in payload ["checks" ]}
732+ assert "claude work loop" not in names
733+ assert not any (name .startswith ("adapter: handoff:" ) for name in names )
734+ assert not any (name .startswith ("adapter: skills:" ) for name in names )
735+
736+ capsys .readouterr ()
737+ doctor_mod .run (target = tmp_target , harness = "generic" )
738+ out = capsys .readouterr ().out
739+ assert "unspecified" in out .lower ()
740+ assert "assuming claude" not in out .lower ()
741+
742+
743+ def test_build_context_claude_declared_labels_adapter_checks (tmp_target : Path , capsys ):
744+ """Explicit Claude selection keeps native checks and labels adapter projections."""
745+ install_selection (
746+ tmp_target ,
747+ Selection (depth = "repo" , harnesses = ["claude" ], owner = "claude" , includes = []),
748+ )
749+ capsys .readouterr ()
750+
751+ ctx = doctor_mod .build_context (tmp_target )
752+ assert ctx .harnesses == ["claude" ]
753+
754+ doctor_mod .run (target = tmp_target , json_output = True )
755+ payload = json .loads (capsys .readouterr ().out )
756+ names = {check ["name" ] for check in payload ["checks" ]}
757+
758+ assert "adapter: handoff: claude inbox" in names
759+ assert "adapter: skills: claude default wired" in names
760+ assert not any (name .startswith ("adapter: handoff: codex" ) for name in names )
761+
762+
763+ def test_build_context_non_claude_harness_labels_adapter_checks_only (tmp_target : Path , capsys ):
764+ """Non-Claude harness selection must not run Claude-native doctor checks."""
765+ install_selection (
766+ tmp_target ,
767+ Selection (depth = "repo" , harnesses = ["codex" ], owner = "codex" , includes = []),
768+ )
769+ capsys .readouterr ()
770+
771+ ctx = doctor_mod .build_context (tmp_target )
772+ assert ctx .harnesses == ["codex" ]
773+
774+ doctor_mod .run (target = tmp_target , json_output = True )
775+ payload = json .loads (capsys .readouterr ().out )
776+ names = {check ["name" ] for check in payload ["checks" ]}
777+
778+ assert "claude work loop" not in names
779+ assert "adapter: handoff: codex inbox" in names
780+ assert "adapter: skills: codex default wired" in names
781+ assert not any (name .startswith ("adapter: handoff: claude" ) for name in names )
782+
783+
716784def test_doctor_includes_embedded_content_guard_without_external_binary (monkeypatch , tmp_target , capsys ):
717785 from brigade .install import install_selection
718786 from brigade .selection import Selection
0 commit comments