feat(platform): close AI expense value loop

Add tenant-safe value, telemetry, connector, commercial, and production-readiness foundations.
This commit is contained in:
caoxiaozhu
2026-07-17 14:14:08 +08:00
parent 242d68c36f
commit 787bc3a481
507 changed files with 82072 additions and 6344 deletions

View File

@@ -0,0 +1,26 @@
from __future__ import annotations
import importlib.util
from pathlib import Path
MIGRATION_PATH = (
Path(__file__).resolve().parents[1]
/ "alembic"
/ "versions"
/ "20260717_0027_knowledge_tenant_security.py"
)
def test_knowledge_security_migration_has_fixed_ancestry_and_fail_closed_downgrade() -> None:
spec = importlib.util.spec_from_file_location("knowledge_security_0027", MIGRATION_PATH)
assert spec is not None and spec.loader is not None
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
assert module.revision == "20260717_0027"
assert module.down_revision == "20260717_0026"
source = MIGRATION_PATH.read_text(encoding="utf-8")
assert "knowledge_onlyoffice_sessions" in source
assert "fk_knowledge_onlyoffice_sessions_tenant" in source
assert "ck_knowledge_onlyoffice_sessions_scope_tenant" in source
assert "OnlyOffice session evidence exists" in source