add agents
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
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" / "physics-evaluation-agent.toml"
|
||||
PHYSICS_EVALUATIONS_README = ROOT / "docs" / "physics-evaluations" / "README.md"
|
||||
|
||||
|
||||
class PhysicsEvaluationAgentConfigTests(unittest.TestCase):
|
||||
def test_physics_evaluation_agent_toml_has_required_codex_fields(self):
|
||||
data = tomllib.loads(AGENT_PATH.read_text(encoding="utf-8"))
|
||||
|
||||
self.assertEqual(data["name"], "physics-evaluation-agent")
|
||||
self.assertIn("physical plausibility", data["description"])
|
||||
self.assertEqual(data["sandbox_mode"], "workspace-write")
|
||||
self.assertEqual(data["model_reasoning_effort"], "high")
|
||||
self.assertIn("developer_instructions", data)
|
||||
|
||||
def test_physics_evaluation_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 change tolerances.",
|
||||
"Do not approve release readiness.",
|
||||
):
|
||||
self.assertIn(required_text, instructions)
|
||||
|
||||
def test_physics_evaluation_agent_instructions_define_physics_checks(self):
|
||||
instructions = AGENT_PATH.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"global equilibrium",
|
||||
"reaction consistency",
|
||||
"displacement direction",
|
||||
"symmetry",
|
||||
"element force balance",
|
||||
"stress/strain",
|
||||
"rigid body mode",
|
||||
"energy/residual",
|
||||
):
|
||||
self.assertIn(required_text, instructions)
|
||||
|
||||
def test_physics_evaluation_agent_instructions_define_output_contract(self):
|
||||
instructions = AGENT_PATH.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"Input Evidence",
|
||||
"Physics Checks",
|
||||
"Failure Classification",
|
||||
"Evaluation Verdict",
|
||||
"Handoff Recommendation",
|
||||
"No-Change Assertion",
|
||||
):
|
||||
self.assertIn(required_text, instructions)
|
||||
|
||||
def test_physics_evaluation_report_guide_defines_template_and_status_values(self):
|
||||
guide = PHYSICS_EVALUATIONS_README.read_text(encoding="utf-8")
|
||||
|
||||
for required_text in (
|
||||
"docs/physics-evaluations/<feature-id>-physics-evaluation.md",
|
||||
"Input Evidence",
|
||||
"Physics Checks",
|
||||
"Failure Classification",
|
||||
"Evaluation Verdict",
|
||||
"Handoff Recommendation",
|
||||
"No-Change Assertion",
|
||||
"pass-for-release-agent",
|
||||
"needs-correction",
|
||||
"needs-reference-model",
|
||||
"needs-upstream-decision",
|
||||
):
|
||||
self.assertIn(required_text, guide)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user