Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ build --java_language_version=17
build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17

# Import AI checker custom configuration
try-import %workspace%/.bazelrc.ai_checker
25 changes: 25 additions & 0 deletions .bazelrc.ai_checker
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
###############################################################################
## GitHub Copilot SDK - Environment (config:copilot)
###############################################################################
# The Copilot CLI needs HOME (for stored OAuth credentials) and proxy vars
# (to reach api.github.com behind a corporate proxy).
#
# These are scoped to --config=copilot so they don't affect other builds.
# The AI checker BUILD target applies this config automatically via a
# test --config=copilot line below.
#
# Auth docs: https://github.com/github/copilot-sdk/blob/main/docs/auth/index.md

# Auth
build:copilot --action_env=HOME
build:copilot --action_env=COPILOT_GITHUB_TOKEN
build:copilot --action_env=GH_TOKEN
build:copilot --action_env=GITHUB_TOKEN

# Proxy (Node.js checks both upper and lowercase)
build:copilot --action_env=HTTP_PROXY
build:copilot --action_env=HTTPS_PROXY
build:copilot --action_env=NO_PROXY
build:copilot --action_env=http_proxy
build:copilot --action_env=https_proxy
build:copilot --action_env=no_proxy
23 changes: 23 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,26 @@ git_override(
commit = "56881461f9d3fde2918d1731aa5937aaf64cd67c",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)

###############################################################################
# Dependencies for AI Checker
###############################################################################

# Make the copilot CLI binary executable (rules_python strips +x from wheels)
pip.whl_mods(
copy_executables = {"site-packages/copilot/bin/copilot": "copilot_cli"},
hub_name = "ai_checker_whl_mods",
whl_name = "github_copilot_sdk",
)
use_repo(pip, "ai_checker_whl_mods")

# Core + LangChain + GitHub Copilot SDK dependencies
pip.parse(
hub_name = "pip_ai_checker",
python_version = PYTHON_VERSION,
requirements_lock = "//validation/ai_checker:requirements.txt",
whl_modifications = {
"@ai_checker_whl_mods//:github_copilot_sdk.json": "github-copilot-sdk",
},
)
use_repo(pip, "pip_ai_checker")
9 changes: 9 additions & 0 deletions defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ load(
# --- starpls ---
load("//starpls:starpls.bzl", _setup_starpls = "setup_starpls")

# --- ai_checker ---
load(
"//validation/ai_checker:ai_checker.bzl",
_architecture_ai_test = "architecture_ai_test",
_trlc_requirements_ai_test = "trlc_requirements_ai_test",
)

score_virtualenv = _score_virtualenv
score_py_pytest = _score_py_pytest
dash_license_checker = _dash_license_checker
Expand All @@ -46,3 +53,5 @@ cli_helper = _cli_helper
use_format_targets = _use_format_targets
setup_starpls = _setup_starpls
rust_coverage_report = _rust_coverage_report
trlc_requirements_ai_test = _trlc_requirements_ai_test
architecture_ai_test = _architecture_ai_test
78 changes: 78 additions & 0 deletions validation/ai_checker/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@pip_ai_checker//:requirements.bzl", "requirement")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

exports_files(
["src/ai_checker/orchestrator.py"],
visibility = ["//visibility:public"],
)

# Default requirements engineering guidelines
filegroup(
name = "default_guidelines",
srcs = glob(["guidelines/*.md"]),
visibility = ["//visibility:public"],
)

# Core AI checker library (analysis framework)
py_library(
name = "ai_checker_core",
srcs = glob(["src/ai_checker/*.py"]),
imports = ["src"],
visibility = ["//visibility:public"],
deps = [
"@trlc//trlc",
requirement("bigtree"),
requirement("pydantic"),
requirement("pydot"),
requirement("pyyaml"),
],
)

# LangChain adapter for GitHub Copilot SDK
py_library(
name = "copilot_langchain",
srcs = [
"src/copilot_adapter/__init__.py",
"src/copilot_adapter/copilot_langchain.py",
],
imports = ["src"],
visibility = ["//visibility:public"],
deps = [
requirement("langchain-core"),
requirement("github-copilot-sdk"),
requirement("pydantic"),
],
)

# Default orchestrator (uses GitHub Copilot SDK as default AI backend)
py_binary(
name = "orchestrator",
srcs = ["src/ai_checker/orchestrator.py"],
imports = ["src"],
main = "src/ai_checker/orchestrator.py",
visibility = ["//visibility:public"],
deps = [
":ai_checker_core",
":copilot_langchain",
requirement("langchain-core"),
],
)

# Run: bazel run //validation/ai_checker:requirements.update
compile_pip_requirements(
name = "requirements",
src = "requirements.txt.in",
requirements_txt = "requirements.txt",
)
Loading
Loading