@@ -28,47 +28,127 @@ filegroup(
2828# Default requirements engineering guidelines
2929filegroup (
3030 name = "default_guidelines" ,
31- srcs = glob (["guidelines/*.md" ]),
31+ srcs = [ "guidelines/general.md" ] + glob (["guidelines/requirements /*.md" ]),
3232 visibility = ["//visibility:public" ],
3333)
3434
35- # Core AI checker library (analysis framework)
35+ # Default architecture design guidelines
36+ filegroup (
37+ name = "default_architecture_guidelines" ,
38+ srcs = ["guidelines/general.md" ] + glob (["guidelines/architecture/*.md" ]),
39+ visibility = ["//visibility:public" ],
40+ )
41+
42+ # Empty default for the project-guideline flags below. Consumer repos override
43+ # the flags in their .bazelrc to inject project-specific guidelines once,
44+ # instead of setting an attribute on every AI test target.
45+ filegroup (
46+ name = "empty_guidelines" ,
47+ srcs = [],
48+ visibility = ["//visibility:public" ],
49+ )
50+
51+ # Project-specific requirement guidelines (graded). Override once via:
52+ # build --//validation/ai_checker:project_guidelines=//path/to:my_guidelines
53+ label_flag (
54+ name = "project_guidelines" ,
55+ build_setting_default = ":empty_guidelines" ,
56+ visibility = ["//visibility:public" ],
57+ )
58+
59+ # Project-specific architecture guidelines (graded). Override once via:
60+ # build --//validation/ai_checker:project_architecture_guidelines=//path/to:my_guidelines
61+ label_flag (
62+ name = "project_architecture_guidelines" ,
63+ build_setting_default = ":empty_guidelines" ,
64+ visibility = ["//visibility:public" ],
65+ )
66+
67+ # Example SCORE project guidelines, referenced by the flags above when a repo
68+ # opts into the SCORE process levels.
69+ filegroup (
70+ name = "score_project_guidelines" ,
71+ srcs = ["guidelines/project/score_requirement_levels.md" ],
72+ visibility = ["//visibility:public" ],
73+ )
74+
75+ filegroup (
76+ name = "score_project_architecture_guidelines" ,
77+ srcs = ["guidelines/project/score_architecture_levels.md" ],
78+ visibility = ["//visibility:public" ],
79+ )
80+
81+ # Core AI checker library (analysis framework).
82+ # Deliberately free of any AI-SDK / LangChain dependency: it depends only on
83+ # the AnalysisAgent interface, which concrete agents implement.
84+ # Core analysis framework + extractors + the AnalysisAgent interface.
85+ # No AI-SDK / LangChain dependency. The agents/ subpackage (concrete backends)
86+ # is intentionally excluded — those are separate libraries below.
3687py_library (
3788 name = "ai_checker_core" ,
38- srcs = glob (["src/ai_checker/*.py" ]),
89+ srcs = glob ([
90+ "src/ai_checker/*.py" ,
91+ "src/ai_checker/extractors/*.py" ,
92+ "src/ai_checker/reports/*.py" ,
93+ ]),
94+ # Jinja2 report templates are loaded at runtime relative to the package,
95+ # so they must travel in the library's runfiles.
96+ data = glob (["src/ai_checker/reports/*.j2" ]),
3997 imports = ["src" ],
4098 visibility = ["//visibility:public" ],
4199 deps = [
42100 "@trlc//trlc" ,
43101 requirement ("bigtree" ),
102+ requirement ("jinja2" ),
103+ requirement ("markupsafe" ),
44104 requirement ("pydantic" ),
45105 requirement ("pydot" ),
46106 requirement ("pyyaml" ),
47107 ],
48108)
49109
50- # LangChain adapter for GitHub Copilot SDK
110+ # Default AI backend: GitHub Copilot SDK agent (no LangChain).
51111py_library (
52- name = "copilot_langchain " ,
112+ name = "copilot_agent " ,
53113 srcs = [
54- "src/copilot_adapter/__init__.py" ,
55- "src/copilot_adapter/_client_manager.py" ,
56- "src/copilot_adapter/_errors.py" ,
57- "src/copilot_adapter/_message_converter.py" ,
58- "src/copilot_adapter/_preflight.py" ,
59- "src/copilot_adapter/_tool_converter.py" ,
60- "src/copilot_adapter/copilot_langchain.py" ,
114+ "src/ai_checker/agents/__init__.py" ,
115+ "src/ai_checker/agents/_client_manager.py" ,
116+ "src/ai_checker/agents/_errors.py" ,
117+ "src/ai_checker/agents/_preflight.py" ,
118+ "src/ai_checker/agents/copilot_agent.py" ,
61119 ],
62120 imports = ["src" ],
63121 visibility = ["//visibility:public" ],
64122 deps = [
65- requirement ( "langchain-core" ) ,
123+ ":ai_checker_core" ,
66124 requirement ("github-copilot-sdk" ),
67125 requirement ("pydantic" ),
68126 ],
69127)
70128
71- # Default orchestrator (uses GitHub Copilot SDK as default AI backend)
129+ # Optional LangChain adapter: wraps any LangChain BaseChatModel (e.g. ChatOpenAI)
130+ # as an AnalysisAgent. Used only when a custom langchain model is supplied via a
131+ # custom ai_model target's create_agent().
132+ py_library (
133+ name = "langchain_agent" ,
134+ srcs = [
135+ "src/ai_checker/agents/__init__.py" ,
136+ "src/ai_checker/agents/_errors.py" ,
137+ "src/ai_checker/agents/langchain_agent.py" ,
138+ ],
139+ imports = ["src" ],
140+ visibility = ["//visibility:public" ],
141+ deps = [
142+ ":ai_checker_core" ,
143+ requirement ("langchain-core" ),
144+ ],
145+ )
146+
147+ # Default orchestrator (uses the Copilot SDK agent as default AI backend).
148+ # Intentionally does NOT depend on :langchain_agent — the default path is
149+ # LangChain-free. A consumer wanting the LangChain path supplies a custom
150+ # ai_model target whose create_agent() returns a LangChainAgent and which
151+ # depends on :langchain_agent itself.
72152py_binary (
73153 name = "orchestrator" ,
74154 srcs = ["src/ai_checker/orchestrator.py" ],
@@ -77,8 +157,7 @@ py_binary(
77157 visibility = ["//visibility:public" ],
78158 deps = [
79159 ":ai_checker_core" ,
80- ":copilot_langchain" ,
81- requirement ("langchain-core" ),
160+ ":copilot_agent" ,
82161 ],
83162)
84163
0 commit comments