feat: add project-scoped operations
Generic Container CI/CD / test-build-publish (push) Failing after 6s
Server CI/CD v2 / build-test-publish-and-deploy (push) Failing after 6s

This commit is contained in:
2026-10-22 18:40:20 +08:00
parent d320972d57
commit 1d061f6099
73 changed files with 4384 additions and 228 deletions
@@ -96,3 +96,30 @@ async def test_preconfigured_service_access_avoids_server_delegation(monkeypatch
assert source.await_args.kwargs["delegated"] is False
assert result.evidence.evidence_id == snapshot.source_ref
service.record_data_snapshot.assert_awaited_once()
@pytest.mark.anyio
async def test_report_endpoints_preserve_interactive_blocks_and_version_context(monkeypatch):
from app.domain.schemas.operational_task import AgentArtifactsCommand, InvestigationReportRevision
from tests.unit.test_report_ui import rich_report
report = rich_report()
snapshot = InvestigationReportRevision(
revision=2, execution_generation=1, source_session_id="session-1",
published_at="2026-10-20T08:00:00Z", published_by="agent", report=report,
)
service = SimpleNamespace(report=AsyncMock(return_value=snapshot),
list_reports=AsyncMock(return_value=([snapshot], None)),
publish_artifacts=AsyncMock(return_value={"report_revision": 2}))
monkeypatch.setattr(endpoints, "_service", lambda _ctx, _conn: service)
task_id = uuid4()
command = AgentArtifactsCommand(request_id=uuid4(), source_session_id="session-1", report=report)
await endpoints.publish_operational_task_artifacts(task_id, command, ctx=_service_context(), conn=object())
assert service.publish_artifacts.await_args.args[1].report.ui_blocks[0].block.block_id == "pressure"
result = await endpoints.get_investigation_report(task_id, 2, ctx=_service_context(), conn=object())
restored = InvestigationReportRevision.model_validate_json(result.model_dump_json())
assert restored.report.ui_blocks[0].block.spec.elements["chart"].props["series"][0]["data"] == [0.3, 0.27]
assert restored.revision == 2
schemas = app.openapi()["components"]["schemas"]
assert "ui_blocks" in schemas["InvestigationReportInput"]["properties"]
assert "ui_blocks" in schemas["InvestigationReport"]["properties"]