Skip to content

Commit cea12db

Browse files
author
wenjiefan
committed
Trim to BCApps review checklists + bump version to 0.7.0
Drop the inline-instructions prompt-gating scaffolding (config.yaml block, prompt._category_context CODE_REVIEW context, and its test). That wiring stays on experiment branches; main only carries the 6 domain checklist md files as dormant assets plus the benchmark version bump.
1 parent 782e73a commit cea12db

4 files changed

Lines changed: 19 additions & 51 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "bcbench"
7-
version = "0.6.0"
7+
version = "0.7.0"
88
description = "Benchmarking tool for Business Central (AL) ecosystem, inspired by SWE-Bench"
99
readme = "README.md"
1010
requires-python = ">=3.13"

src/bcbench/agent/shared/config.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ prompt:
6565
- body: concise description of the issue (string, required)
6666
6767
If there are no findings, write an empty array. Write only valid JSON to review.json, with no surrounding markdown or commentary.
68-
{% if inline_instructions_enabled %}
69-
Evaluate the diff against every one of the following domain checklists. Read each file under `.github/instructions/` (or `.claude/instructions/`) and apply its guidance:
70-
- `instructions/security.md` — security
71-
- `instructions/performance.md` — performance
72-
- `instructions/privacy.md` — privacy and data protection
73-
- `instructions/style.md` — AL style and conventions
74-
- `instructions/accessibility.md` — accessibility
75-
- `instructions/upgrade.md` — upgrade and data-migration safety
76-
Only raise findings supported by one of these checklists. For each finding, cite the concrete rule it violates and point to the exact file and line in the diff.
77-
{% endif %}
7868
7969
# controls:
8070
# 1. whether to copy custom instructions from `src/bcbench/agent/shared/instructions/<sanitized-repo>/`

src/bcbench/agent/shared/prompt.py

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,21 @@ def _transform_image_paths(content: str) -> str:
1818
def build_prompt(entry: BaseDatasetEntry, repo_path: Path, config: dict, category: EvaluationCategory, al_mcp: bool = False) -> str:
1919
prompt_config = config.get("prompt", {})
2020
template_str = prompt_config.get(f"{category.value}-template")
21-
22-
context = {
23-
"repo_path": repo_path,
24-
"task": _transform_image_paths(entry.get_task()),
25-
"project_paths": ", ".join(entry.project_paths),
26-
"include_project_paths": prompt_config.get("include_project_paths"),
27-
"al_mcp": al_mcp,
28-
}
29-
context |= _category_context(category, config)
30-
31-
return Template(template_str).render(**context)
32-
33-
34-
def _category_context(category: EvaluationCategory, config: dict) -> dict:
35-
match category:
36-
case EvaluationCategory.TEST_GENERATION:
37-
mode = config.get("prompt", {}).get("test-generation-input", "problem-statement")
38-
return {
39-
"is_gold_patch": mode in ("gold-patch", "both"),
40-
"is_problem_statement": mode in ("problem-statement", "both"),
41-
}
42-
case EvaluationCategory.CODE_REVIEW:
43-
return {"inline_instructions_enabled": config.get("instructions", {}).get("enabled", False)}
44-
case _:
45-
return {}
21+
include_project_paths = prompt_config.get("include_project_paths")
22+
23+
test_gen_input: str = prompt_config.get("test-generation-input", "problem-statement")
24+
is_gold_patch: bool = category == EvaluationCategory.TEST_GENERATION and test_gen_input in ("gold-patch", "both")
25+
is_problem_statement: bool = category == EvaluationCategory.TEST_GENERATION and test_gen_input in ("problem-statement", "both")
26+
27+
task = _transform_image_paths(entry.get_task())
28+
29+
template = Template(template_str)
30+
return template.render(
31+
repo_path=repo_path,
32+
task=task,
33+
project_paths=", ".join(entry.project_paths),
34+
include_project_paths=include_project_paths,
35+
is_gold_patch=is_gold_patch, # only relevant for test-generation
36+
is_problem_statement=is_problem_statement, # only relevant for test-generation
37+
al_mcp=al_mcp, # whether AL MCP server is enabled
38+
)

tests/test_copilot_prompt.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,18 +130,3 @@ def test_build_prompt_test_generation_both_mode(tmp_path: Path):
130130
assert "[HAS_PATCH]" in result # gold patch should be indicated
131131
assert "[HAS_ISSUE]" in result # problem statement should be indicated
132132
assert "Fix payment validation bug" in result # task should be included in both mode
133-
134-
135-
def test_code_review_prompt_checklists_only_with_custom_instructions(tmp_path: Path):
136-
entry = create_dataset_entry(instance_id="microsoftInternal__NAV-9", project_paths=["App/app"])
137-
repo_path = tmp_path / "navapp"
138-
repo_path.mkdir()
139-
problem_dir = create_problem_statement_dir(tmp_path, "Review the change")
140-
template = {"code-review-template": "/review\n{% if inline_instructions_enabled %}Read instructions/security.md{% endif %}"}
141-
142-
with patch.object(type(entry), "problem_statement_dir", property(lambda self: problem_dir)):
143-
with_inline = build_prompt(entry, repo_path, {"prompt": template, "instructions": {"enabled": True}}, EvaluationCategory.CODE_REVIEW)
144-
without_inline = build_prompt(entry, repo_path, {"prompt": template, "instructions": {"enabled": False}}, EvaluationCategory.CODE_REVIEW)
145-
146-
assert "security.md" in with_inline
147-
assert "security.md" not in without_inline

0 commit comments

Comments
 (0)