M8.0/M8.V1: Add contract inference engine and deterministic conformance testing
This commit is contained in:
@@ -560,6 +560,35 @@ def test_inspect_with_registry_uses_similarity_results(monkeypatch, capsys):
|
||||
assert "official/summarize" in capsys.readouterr().out
|
||||
|
||||
|
||||
def test_inspect_shows_contract_proposal_and_passing_conformance(
|
||||
monkeypatch, capsys
|
||||
):
|
||||
from cmdforge.cli import cmd_inspect
|
||||
|
||||
step_schema = {
|
||||
"type": "object",
|
||||
"properties": {"answer": {"type": "string"}},
|
||||
"required": ["answer"],
|
||||
}
|
||||
tool = Tool(
|
||||
name="contracted",
|
||||
arguments=[],
|
||||
input_schema={},
|
||||
output_schema=step_schema,
|
||||
steps=[PromptStep(
|
||||
prompt="Answer", provider="paid-provider", output_var="answer",
|
||||
output_schema=step_schema,
|
||||
)],
|
||||
output="{answer}",
|
||||
)
|
||||
monkeypatch.setattr("cmdforge.tool.load_tool", lambda name: tool)
|
||||
|
||||
assert cmd_inspect(SimpleNamespace(name="contracted", registry=False)) == 0
|
||||
output = capsys.readouterr().out
|
||||
assert "Contract conformance" in output
|
||||
assert "PASSED" in output
|
||||
|
||||
|
||||
def test_switch_to_existing_tool_closes_creation_page_first():
|
||||
pytest.importorskip("PySide6")
|
||||
from cmdforge.gui.pages.tool_builder_page import _switch_to_existing_tool
|
||||
|
||||
Reference in New Issue
Block a user