add agents
This commit is contained in:
@@ -0,0 +1,86 @@
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import tomllib
|
||||
except ModuleNotFoundError: # pragma: no cover
|
||||
import tomli as tomllib
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
AGENT_PATH = ROOT / ".codex" / "agents" / "build-test-executor-agent.toml"
|
||||
BUILD_TEST_REPORTS_README = ROOT / "docs" / "build-test-reports" / "README.md"
|
||||
|
||||
|
||||
class BuildTestExecutorAgentConfigTests(unittest.TestCase):
|
||||
def test_build_test_executor_agent_toml_has_required_codex_fields(self):
|
||||
data = tomllib.loads(AGENT_PATH.read_text(encoding="utf-8"))
|
||||
|
||||
self.assertEqual(data["name"], "build-test-executor-agent")
|
||||
self.assertIn("C++/MSVC/CMake/CTest validation", data["description"])
|
||||
self.assertEqual(data["sandbox_mode"], "workspace-write")
|
||||
self.assertEqual(data["model_reasoning_effort"], "high")
|
||||
self.assertIn("developer_instructions", data)
|
||||
|
||||
def test_build_test_executor_agent_instructions_enforce_boundaries(self):
|
||||
instructions = AGENT_PATH.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"Do not edit source code.",
|
||||
"Do not edit tests.",
|
||||
"Do not edit CMake.",
|
||||
"Do not run Abaqus, Nastran, or any reference solver.",
|
||||
"Do not generate reference CSVs.",
|
||||
"Do not approve release readiness.",
|
||||
):
|
||||
self.assertIn(required_text, instructions)
|
||||
|
||||
def test_build_test_executor_agent_instructions_define_validation_contract(self):
|
||||
instructions = AGENT_PATH.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"python scripts/validate_workspace.py",
|
||||
"HARNESS_VALIDATION_COMMANDS",
|
||||
"msvc-debug",
|
||||
"CMake/MSVC x64 Debug",
|
||||
"ctest --test-dir",
|
||||
"--output-on-failure",
|
||||
"-C Debug",
|
||||
):
|
||||
self.assertIn(required_text, instructions)
|
||||
|
||||
def test_build_test_executor_agent_instructions_define_output_contract(self):
|
||||
instructions = AGENT_PATH.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"Execution Environment",
|
||||
"Command Log Summary",
|
||||
"Validation Results",
|
||||
"Failure Classification",
|
||||
"Failed Test Inventory",
|
||||
"Handoff Recommendation",
|
||||
"No-Change Assertion",
|
||||
):
|
||||
self.assertIn(required_text, instructions)
|
||||
|
||||
def test_build_test_report_guide_defines_template_and_status_values(self):
|
||||
guide = BUILD_TEST_REPORTS_README.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"docs/build-test-reports/<feature-id>-build-test.md",
|
||||
"Execution Environment",
|
||||
"Command Log Summary",
|
||||
"Validation Results",
|
||||
"Failure Classification",
|
||||
"Failed Test Inventory",
|
||||
"Handoff Recommendation",
|
||||
"No-Change Assertion",
|
||||
"pass-for-reference-verification",
|
||||
"needs-correction",
|
||||
"needs-environment-fix",
|
||||
):
|
||||
self.assertIn(required_text, guide)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user