Skip to content

Commit f40c5d8

Browse files
sjarmakclaude
andcommitted
fix: pin SDLC MCP mirrors + propagate SOURCEGRAPH_REPO_NAME from container
Created 4 new sg-benchmarks mirrors at Dockerfile-pinned versions for 5 at-risk SDLC tasks: - curl--09e25b9d (8.4.0-DEV) for curl-cve-triage-001, curl-vuln-reachability-001 - vscode--1960 (1.96.0) for vscode-code-review-001 - envoy--v1330 (v1.33.0) for envoy-code-review-001 - kafka--0cd95bc2 (pre-fix SCRAM) for kafka-vuln-reachability-001 Added ENV SOURCEGRAPH_REPO_NAME to each task's Dockerfile.sg_only so the V5 preamble directs the agent to the correct mirror. Updated claude_baseline_agent.py to propagate SOURCEGRAPH_REPO_NAME from the container env (via environment.exec) into _container_env_cache, matching the existing pattern for LOCOBENCH_PROJECT_ID and SWEBENCH_REPO_COMMIT. Previously only read from host os.environ. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ba67770 commit f40c5d8

File tree

6 files changed

+12
-5
lines changed

6 files changed

+12
-5
lines changed

agents/claude_baseline_agent.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,15 @@ def _get_repo_display(self) -> str:
359359
(checked in host env AND _container_env_cache populated by setup())
360360
4. Fallback: "the codebase"
361361
"""
362-
sg_repo_name = os.environ.get("SOURCEGRAPH_REPO_NAME", "")
362+
cache = getattr(self, '_container_env_cache', {})
363+
364+
sg_repo_name = os.environ.get("SOURCEGRAPH_REPO_NAME", "") or cache.get("SOURCEGRAPH_REPO_NAME", "")
363365
if sg_repo_name:
364366
# Strip github.com/ prefix if present — templates add it back
365367
if sg_repo_name.startswith("github.com/"):
366368
return sg_repo_name[len("github.com/"):]
367369
return sg_repo_name
368370

369-
cache = getattr(self, '_container_env_cache', {})
370-
371371
locobench_prefix = os.environ.get("LOCOBENCH_PROJECT_ID", "") or cache.get("LOCOBENCH_PROJECT_ID", "")
372372
if locobench_prefix:
373373
return f"sg-benchmarks/locobench-{locobench_prefix}"
@@ -1037,8 +1037,8 @@ async def setup(self, environment: BaseEnvironment) -> None:
10371037
mcp_type_setup = os.environ.get("BASELINE_MCP_TYPE", "none").lower()
10381038
if mcp_type_setup != "none":
10391039
self._container_env_cache = {}
1040-
for var_name in ("LOCOBENCH_PROJECT_ID", "SWEBENCH_REPO_COMMIT"):
1041-
if not os.environ.get("SOURCEGRAPH_REPO_NAME") and not os.environ.get(var_name):
1040+
for var_name in ("SOURCEGRAPH_REPO_NAME", "LOCOBENCH_PROJECT_ID", "SWEBENCH_REPO_COMMIT"):
1041+
if not os.environ.get(var_name):
10421042
try:
10431043
result = await environment.exec(f'echo ${{{var_name}:-}}')
10441044
# Filter out bash warning messages (e.g., "bash: cannot set terminal process group")

benchmarks/ccb_secure/curl-cve-triage-001/environment/Dockerfile.sg_only

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
FROM debian:bookworm-slim
55

66
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV SOURCEGRAPH_REPO_NAME=sg-benchmarks/curl--09e25b9d
78

89
RUN apt-get update && apt-get install -y --no-install-recommends \
910
git \

benchmarks/ccb_secure/curl-vuln-reachability-001/environment/Dockerfile.sg_only

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
FROM debian:bookworm-slim
55

66
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV SOURCEGRAPH_REPO_NAME=sg-benchmarks/curl--09e25b9d
78

89
RUN apt-get update && apt-get install -y --no-install-recommends \
910
git \

benchmarks/ccb_secure/kafka-vuln-reachability-001/environment/Dockerfile.sg_only

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
FROM eclipse-temurin:17-jdk
55

66
ENV DEBIAN_FRONTEND=noninteractive
7+
ENV SOURCEGRAPH_REPO_NAME=sg-benchmarks/kafka--0cd95bc2
78

89
RUN apt-get update && apt-get install -y --no-install-recommends \
910
git \

benchmarks/ccb_test/envoy-code-review-001/environment/Dockerfile.sg_only

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN if ! command -v node &> /dev/null; then \
1919
apt-get install -y --no-install-recommends nodejs; \
2020
fi
2121

22+
ENV SOURCEGRAPH_REPO_NAME=sg-benchmarks/envoy--v1330
23+
2224
# Clone envoyproxy/envoy at pinned v1.33.0 tag (sparse checkout for relevant files)
2325
RUN git clone --filter=blob:none --no-checkout https://github.com/envoyproxy/envoy.git /workspace && \
2426
cd /workspace && \

benchmarks/ccb_test/vscode-code-review-001/environment/Dockerfile.sg_only

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ RUN if ! command -v node &> /dev/null; then \
1919
apt-get install -y --no-install-recommends nodejs; \
2020
fi
2121

22+
ENV SOURCEGRAPH_REPO_NAME=sg-benchmarks/vscode--1960
23+
2224
# Clone microsoft/vscode at pinned 1.96.0 tag (sparse checkout for relevant files)
2325
RUN git clone --filter=blob:none --no-checkout https://github.com/microsoft/vscode.git /workspace && \
2426
cd /workspace && \

0 commit comments

Comments
 (0)