File size: 2,241 Bytes
f440f03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""Tests for coder execution benchmark dataset coverage."""

import json
from pathlib import Path

from maris_core.text.benchmark import load_chat_benchmark_dataset


def test_coder_execution_benchmark_dataset_covers_primary_languages() -> None:
    dataset_path = Path(
        "/home/runner/work/Maris-MI/Maris-MI/core-python/evals/coder_execution_benchmark.json"
    )

    cases = load_chat_benchmark_dataset(dataset_path)

    languages = {case.execution_language for case in cases if case.execution_language}
    assert {"python", "typescript", "rust", "sql"}.issubset(languages)
    assert all(case.level == "ci" for case in cases)


def test_coder_release_benchmark_dataset_is_execution_and_repo_heavy() -> None:
    dataset_path = Path(
        "/home/runner/work/Maris-MI/Maris-MI/core-python/evals/coder_release_benchmark.json"
    )

    cases = load_chat_benchmark_dataset(dataset_path)

    execution_cases = [case for case in cases if case.execution_language]
    repo_cases = [case for case in cases if "repo-level" in case.tags or "diff" in case.tags]
    assert len(cases) >= 10
    assert len(execution_cases) >= 5
    assert repo_cases
    assert any("multi-file" in case.tags for case in cases)
    assert any("regression-risk" in case.tags for case in cases)
    assert any("incident-recovery" in case.tags for case in cases)
    assert any("debugging" in case.tags for case in cases)


def test_coder_sample_dataset_covers_repo_diff_and_incident_work() -> None:
    dataset_path = Path("/home/runner/work/Maris-MI/Maris-MI/data/code/sample.jsonl")

    records = [
        json.loads(line)
        for line in dataset_path.read_text(encoding="utf-8").splitlines()
        if line.strip()
    ]

    task_types = {str(record.get("metadata", {}).get("task", "")).strip() for record in records}
    repo_context_counts = [len(record.get("repo_context", [])) for record in records]
    prompts = [str(record.get("prompt", "")) for record in records]

    assert {"repo-level", "bugfix", "refactor", "ci-orchestration"}.issubset(task_types)
    assert max(repo_context_counts) >= 2
    assert any("incident" in prompt.lower() for prompt in prompts)
    assert any(str(record.get("diff", "")).strip() for record in records)