Optimize AI structure output for Codex
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-21 20:51:34 +03:00
parent e86f6be385
commit cbcfcc1741
4 changed files with 180 additions and 4 deletions
+11 -1
View File
@@ -1702,9 +1702,17 @@ def test_ai_structure_prepare_writes_ai_ready_package(tmp_path: Path):
payload = response.json()
assert payload["status"] == "ready"
assert payload["snapshot"]["nodes"] >= 2
codex_package = output / payload["codex_package_folder"]
assert (output / "manifest.json").exists()
assert (output / "normalized_project.json").exists()
assert (output / "sir_snapshot.json").exists()
assert (codex_package / "AGENTS.md").exists()
assert (codex_package / "README.md").exists()
assert (codex_package / "context" / "project-overview.md").exists()
assert (codex_package / "indexes" / "objects.json").exists()
assert (codex_package / "raw" / "normalized_project.json").exists()
assert "generated by SFERA for Codex" in (codex_package / "AGENTS.md").read_text(encoding="utf-8")
assert "Copy this whole folder into the Codex project" in (codex_package / "README.md").read_text(encoding="utf-8")
assert "Treat modules/forms/commands as parts" in (output / "ai_context.md").read_text(encoding="utf-8")
page = client.get("/html5/projects/ai-demo/ai-structure")
@@ -1714,7 +1722,7 @@ def test_ai_structure_prepare_writes_ai_ready_package(tmp_path: Path):
"/html5/projects/ai-demo/ai-structure/run",
data={"project_id": "ai-demo-html5", "input_path": str(source), "output_path": str(tmp_path / "html5-out")},
)
assert_html5_response_contract(html5_run, "ready", "sir_snapshot.json", "normalized_project.json")
assert_html5_response_contract(html5_run, "ready", "codex-1c-context-ai-demo-html5", "sir_snapshot.json", "normalized_project.json")
def test_ai_structure_prepare_reports_cf_cfe_export_required(tmp_path: Path):
@@ -1735,6 +1743,8 @@ def test_ai_structure_prepare_reports_cf_cfe_export_required(tmp_path: Path):
assert payload["status"] == "export_required"
assert len(payload["binary_1c_files"]) == 2
assert "DumpConfigToFiles" in (output / "export_plan.md").read_text(encoding="utf-8")
assert (output / payload["codex_package_folder"] / "AGENTS.md").exists()
assert "export_required" in (output / payload["codex_package_folder"] / "README.md").read_text(encoding="utf-8")
def test_import_full_replace_replaces_current_normalized_project(tmp_path: Path):