Localize AI structure UI and fix form layout
CI / python (push) Has been cancelled
CI / rust (push) Has been cancelled

This commit is contained in:
2026-05-22 00:09:58 +03:00
parent 4afbb493b4
commit afb455a2c6
4 changed files with 128 additions and 100 deletions
+9 -8
View File
@@ -1720,11 +1720,11 @@ def test_ai_structure_prepare_writes_ai_ready_package(tmp_path: Path):
modules_index = json.loads((codex_package / "indexes" / "modules.json").read_text(encoding="utf-8"))
assert any(item.get("local_source_path") == "source/Интеграция.bsl" for item in modules_index)
module_docs = "\n".join(path.read_text(encoding="utf-8") for path in (codex_package / "modules").glob("*.md"))
assert "Local source: `source/Интеграция.bsl`" in module_docs
assert "generated by SFERA for Codex" in (codex_package / "AGENTS.md").read_text(encoding="utf-8")
assert "Use `source/`" 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")
assert "Локальный исходник: `source/Интеграция.bsl`" in module_docs
assert "Эта папка сгенерирована SFERA для Codex" in (codex_package / "AGENTS.md").read_text(encoding="utf-8")
assert "локальную папку `source/`" in (codex_package / "AGENTS.md").read_text(encoding="utf-8")
assert "Перенесите эту папку целиком в проект Codex" in (codex_package / "README.md").read_text(encoding="utf-8")
assert "Рассматривайте модули, формы и команды как части объектов 1С-владельцев" in (output / "ai_context.md").read_text(encoding="utf-8")
page = client.get("/html5/projects/ai-demo/ai-structure")
assert_html5_response_contract(
@@ -1738,6 +1738,7 @@ def test_ai_structure_prepare_writes_ai_ready_package(tmp_path: Path):
"data-ai-structure-progress",
"Осталось примерно",
"html5-ai-structure.js",
"Идентификатор проекта",
full_page=True,
)
@@ -1745,13 +1746,13 @@ 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", "codex-1c-context-ai-demo-html5", "sir_snapshot.json", "normalized_project.json")
assert_html5_response_contract(html5_run, "готово", "codex-1c-context-ai-demo-html5", "Снимок графа SIR", "Нормализованный проект")
html5_missing = client.post(
"/html5/projects/ai-demo/ai-structure/run",
data={"project_id": "ai-demo-html5", "input_path": str(tmp_path / "missing"), "output_path": str(tmp_path / "html5-out")},
)
assert_html5_response_contract(html5_missing, "ошибка", "Input path not found")
assert_html5_response_contract(html5_missing, "ошибка", "Входная папка не найдена")
html5_smb_without_credentials = client.post(
"/html5/projects/ai-demo/ai-structure/run",
@@ -1783,7 +1784,7 @@ def test_ai_structure_prepare_reports_cf_cfe_export_required(tmp_path: Path):
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")
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):