cloud-dog-llm 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. cloud_dog_llm-0.3.0/.gitignore +16 -0
  2. cloud_dog_llm-0.3.0/AGENT-INSTRUCTION-FIX-LLM.md +213 -0
  3. cloud_dog_llm-0.3.0/AGENT-INSTRUCTION-FIX-UT-SKIPS.md +69 -0
  4. cloud_dog_llm-0.3.0/ARCHITECTURE.md +504 -0
  5. cloud_dog_llm-0.3.0/BUILD.md +74 -0
  6. cloud_dog_llm-0.3.0/CHANGELOG.md +6 -0
  7. cloud_dog_llm-0.3.0/LICENCE +190 -0
  8. cloud_dog_llm-0.3.0/LICENSE +176 -0
  9. cloud_dog_llm-0.3.0/MCP-MIGRATION.md +17 -0
  10. cloud_dog_llm-0.3.0/NOTICE +7 -0
  11. cloud_dog_llm-0.3.0/PKG-INFO +33 -0
  12. cloud_dog_llm-0.3.0/README.md +87 -0
  13. cloud_dog_llm-0.3.0/REQUIREMENTS.md +343 -0
  14. cloud_dog_llm-0.3.0/TESTS.md +303 -0
  15. cloud_dog_llm-0.3.0/adoption_test.py +74 -0
  16. cloud_dog_llm-0.3.0/cloud_dog_llm/__init__.py +38 -0
  17. cloud_dog_llm-0.3.0/cloud_dog_llm/a2a/__init__.py +20 -0
  18. cloud_dog_llm-0.3.0/cloud_dog_llm/a2a/client.py +41 -0
  19. cloud_dog_llm-0.3.0/cloud_dog_llm/a2a/envelope.py +27 -0
  20. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/__init__.py +30 -0
  21. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/base.py +33 -0
  22. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/local.py +62 -0
  23. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/memory.py +37 -0
  24. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/models.py +22 -0
  25. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/s3.py +35 -0
  26. cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/store.py +75 -0
  27. cloud_dog_llm-0.3.0/cloud_dog_llm/availability/__init__.py +19 -0
  28. cloud_dog_llm-0.3.0/cloud_dog_llm/availability/gating.py +91 -0
  29. cloud_dog_llm-0.3.0/cloud_dog_llm/compat/__init__.py +20 -0
  30. cloud_dog_llm-0.3.0/cloud_dog_llm/compat/formatter_compat.py +64 -0
  31. cloud_dog_llm-0.3.0/cloud_dog_llm/compat/response_adapter.py +167 -0
  32. cloud_dog_llm-0.3.0/cloud_dog_llm/config/__init__.py +15 -0
  33. cloud_dog_llm-0.3.0/cloud_dog_llm/config/models.py +44 -0
  34. cloud_dog_llm-0.3.0/cloud_dog_llm/config/registry.py +56 -0
  35. cloud_dog_llm-0.3.0/cloud_dog_llm/config/settings.py +41 -0
  36. cloud_dog_llm-0.3.0/cloud_dog_llm/domain/__init__.py +15 -0
  37. cloud_dog_llm-0.3.0/cloud_dog_llm/domain/enums.py +47 -0
  38. cloud_dog_llm-0.3.0/cloud_dog_llm/domain/errors.py +69 -0
  39. cloud_dog_llm-0.3.0/cloud_dog_llm/domain/models.py +87 -0
  40. cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/__init__.py +22 -0
  41. cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/base.py +33 -0
  42. cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/manager.py +35 -0
  43. cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/ollama.py +27 -0
  44. cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/openai_compat.py +27 -0
  45. cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/providers.py +27 -0
  46. cloud_dog_llm-0.3.0/cloud_dog_llm/factory.py +89 -0
  47. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/__init__.py +21 -0
  48. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/client.py +69 -0
  49. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/fastmcp.py +31 -0
  50. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/session.py +30 -0
  51. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transport.py +36 -0
  52. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/http_jsonrpc.py +33 -0
  53. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/legacy_sse.py +33 -0
  54. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/stdio.py +28 -0
  55. cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/streamable_http.py +33 -0
  56. cloud_dog_llm-0.3.0/cloud_dog_llm/middleware/__init__.py +31 -0
  57. cloud_dog_llm-0.3.0/cloud_dog_llm/middleware/base.py +99 -0
  58. cloud_dog_llm-0.3.0/cloud_dog_llm/middleware/reliability.py +117 -0
  59. cloud_dog_llm-0.3.0/cloud_dog_llm/multimodal/__init__.py +21 -0
  60. cloud_dog_llm-0.3.0/cloud_dog_llm/multimodal/handler.py +65 -0
  61. cloud_dog_llm-0.3.0/cloud_dog_llm/multimodal/models.py +46 -0
  62. cloud_dog_llm-0.3.0/cloud_dog_llm/observability/__init__.py +23 -0
  63. cloud_dog_llm-0.3.0/cloud_dog_llm/observability/audit.py +30 -0
  64. cloud_dog_llm-0.3.0/cloud_dog_llm/observability/logging.py +34 -0
  65. cloud_dog_llm-0.3.0/cloud_dog_llm/observability/metrics.py +51 -0
  66. cloud_dog_llm-0.3.0/cloud_dog_llm/observability/otel.py +40 -0
  67. cloud_dog_llm-0.3.0/cloud_dog_llm/observability/redaction.py +38 -0
  68. cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/__init__.py +27 -0
  69. cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/registry.py +45 -0
  70. cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/render.py +39 -0
  71. cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/template.py +33 -0
  72. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/__init__.py +33 -0
  73. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/anthropic.py +180 -0
  74. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/base.py +48 -0
  75. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/factory.py +49 -0
  76. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/ollama.py +173 -0
  77. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/openai.py +32 -0
  78. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/openai_compat.py +195 -0
  79. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/openrouter.py +39 -0
  80. cloud_dog_llm-0.3.0/cloud_dog_llm/providers/registry.py +44 -0
  81. cloud_dog_llm-0.3.0/cloud_dog_llm/registry/__init__.py +15 -0
  82. cloud_dog_llm-0.3.0/cloud_dog_llm/registry/capabilities.py +43 -0
  83. cloud_dog_llm-0.3.0/cloud_dog_llm/registry/registry.py +67 -0
  84. cloud_dog_llm-0.3.0/cloud_dog_llm/routing/__init__.py +20 -0
  85. cloud_dog_llm-0.3.0/cloud_dog_llm/routing/engine.py +51 -0
  86. cloud_dog_llm-0.3.0/cloud_dog_llm/routing/policies.py +41 -0
  87. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/__init__.py +40 -0
  88. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/cancel.py +28 -0
  89. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/cancellation.py +39 -0
  90. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/client.py +89 -0
  91. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/job_invoker.py +117 -0
  92. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/params.py +36 -0
  93. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/response.py +46 -0
  94. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/retries.py +51 -0
  95. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/retry.py +46 -0
  96. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/session.py +27 -0
  97. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/streaming.py +78 -0
  98. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/timeout.py +30 -0
  99. cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/timeouts.py +29 -0
  100. cloud_dog_llm-0.3.0/cloud_dog_llm/security/__init__.py +30 -0
  101. cloud_dog_llm-0.3.0/cloud_dog_llm/security/governance.py +30 -0
  102. cloud_dog_llm-0.3.0/cloud_dog_llm/security/policies.py +51 -0
  103. cloud_dog_llm-0.3.0/cloud_dog_llm/security/rbac.py +41 -0
  104. cloud_dog_llm-0.3.0/cloud_dog_llm/security/redaction.py +34 -0
  105. cloud_dog_llm-0.3.0/cloud_dog_llm/security/secrets.py +38 -0
  106. cloud_dog_llm-0.3.0/cloud_dog_llm/security/tools_policy.py +32 -0
  107. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/__init__.py +31 -0
  108. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/extractor.py +34 -0
  109. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/parser.py +32 -0
  110. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/reducer.py +28 -0
  111. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/repair.py +42 -0
  112. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/schema.py +43 -0
  113. cloud_dog_llm-0.3.0/cloud_dog_llm/structured/validator.py +38 -0
  114. cloud_dog_llm-0.3.0/cloud_dog_llm/testing/__init__.py +22 -0
  115. cloud_dog_llm-0.3.0/cloud_dog_llm/testing/conformance.py +29 -0
  116. cloud_dog_llm-0.3.0/cloud_dog_llm/testing/fixtures.py +35 -0
  117. cloud_dog_llm-0.3.0/cloud_dog_llm/testing/mock_providers.py +43 -0
  118. cloud_dog_llm-0.3.0/cloud_dog_llm/testing/vcr.py +79 -0
  119. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/__init__.py +38 -0
  120. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/calling.py +89 -0
  121. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/executor.py +43 -0
  122. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/local.py +36 -0
  123. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/models.py +51 -0
  124. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/parser.py +34 -0
  125. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/pipeline.py +83 -0
  126. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/reducer.py +41 -0
  127. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/router.py +55 -0
  128. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/schema.py +38 -0
  129. cloud_dog_llm-0.3.0/cloud_dog_llm/tools/schemas.py +27 -0
  130. cloud_dog_llm-0.3.0/cloud_dog_llm/traceability_ids.py +63 -0
  131. cloud_dog_llm-0.3.0/defaults.yaml +65 -0
  132. cloud_dog_llm-0.3.0/docs/ARCHITECTURE.md +17 -0
  133. cloud_dog_llm-0.3.0/docs/CONFIGURATION.md +16 -0
  134. cloud_dog_llm-0.3.0/docs/EXAMPLES.md +10 -0
  135. cloud_dog_llm-0.3.0/pyproject.toml +44 -0
  136. cloud_dog_llm-0.3.0/scaffold/cloud_dog_llm/__init__.py +32 -0
  137. cloud_dog_llm-0.3.0/scaffold/defaults.yaml +65 -0
  138. cloud_dog_llm-0.3.0/scaffold/pyproject.toml +29 -0
  139. cloud_dog_llm-0.3.0/scaffold/tests/conftest.py +73 -0
  140. cloud_dog_llm-0.3.0/tests/__init__.py +13 -0
  141. cloud_dog_llm-0.3.0/tests/application/AT1.1_ServiceStartupPattern/test_service_startup.py +83 -0
  142. cloud_dog_llm-0.3.0/tests/application/AT1.2_ChatWithToolCalling/test_chat_tools.py +36 -0
  143. cloud_dog_llm-0.3.0/tests/application/AT1.3_MCPAllTransports/test_mcp_transports.py +38 -0
  144. cloud_dog_llm-0.3.0/tests/application/AT1.4_ConformanceSuite/test_conformance.py +39 -0
  145. cloud_dog_llm-0.3.0/tests/application/AT1.5_ResponseAdapterIntegration/test_response_adapter_integration.py +65 -0
  146. cloud_dog_llm-0.3.0/tests/conftest.py +97 -0
  147. cloud_dog_llm-0.3.0/tests/env-AT +2 -0
  148. cloud_dog_llm-0.3.0/tests/env-IT +3 -0
  149. cloud_dog_llm-0.3.0/tests/env-ST +2 -0
  150. cloud_dog_llm-0.3.0/tests/env-UT +2 -0
  151. cloud_dog_llm-0.3.0/tests/integration/IT1.1_OllamaChat/test_ollama_chat.py +72 -0
  152. cloud_dog_llm-0.3.0/tests/integration/IT1.2_OllamaStream/test_ollama_stream.py +75 -0
  153. cloud_dog_llm-0.3.0/tests/integration/IT1.3_OllamaEmbeddings/test_ollama_embed.py +66 -0
  154. cloud_dog_llm-0.3.0/tests/integration/IT1.4_OpenRouterChat/test_openrouter_chat.py +88 -0
  155. cloud_dog_llm-0.3.0/tests/integration/IT1.5_MCPServerIntegration/test_mcp_server.py +43 -0
  156. cloud_dog_llm-0.3.0/tests/integration/IT1.6_ToolCallingRealLLM/test_tool_calling_real.py +70 -0
  157. cloud_dog_llm-0.3.0/tests/integration/IT1.7_MultiProviderBackend/test_multi_backend.py +86 -0
  158. cloud_dog_llm-0.3.0/tests/integration/__init__.py +13 -0
  159. cloud_dog_llm-0.3.0/tests/integration/vault_models.py +76 -0
  160. cloud_dog_llm-0.3.0/tests/quality/QT_PUBLISH_COMPLIANCE/__init__.py +2 -0
  161. cloud_dog_llm-0.3.0/tests/quality/QT_PUBLISH_COMPLIANCE/test_publish_compliance.py +58 -0
  162. cloud_dog_llm-0.3.0/tests/quality/__init__.py +2 -0
  163. cloud_dog_llm-0.3.0/tests/security/QT1.1_SecretRedaction/test_secret_redaction.py +30 -0
  164. cloud_dog_llm-0.3.0/tests/security/QT1.2_GovernancePolicies/test_governance.py +49 -0
  165. cloud_dog_llm-0.3.0/tests/security/QT1.3_ToolAccessPolicies/test_tool_policies.py +33 -0
  166. cloud_dog_llm-0.3.0/tests/system/ST1.1_ChatEndToEnd/test_chat_e2e.py +51 -0
  167. cloud_dog_llm-0.3.0/tests/system/ST1.2_StreamEndToEnd/test_stream_e2e.py +52 -0
  168. cloud_dog_llm-0.3.0/tests/system/ST1.3_ToolCallEndToEnd/test_tool_call_e2e.py +35 -0
  169. cloud_dog_llm-0.3.0/tests/system/ST1.4_MCPToolCallEndToEnd/test_mcp_tool_e2e.py +40 -0
  170. cloud_dog_llm-0.3.0/tests/system/ST1.5_PromptRenderToChat/test_prompt_to_chat.py +55 -0
  171. cloud_dog_llm-0.3.0/tests/system/ST1.6_MultiProviderSwitch/test_multi_provider.py +65 -0
  172. cloud_dog_llm-0.3.0/tests/system/ST1.7_ReliabilityMiddlewareEndToEnd/test_reliability_e2e.py +68 -0
  173. cloud_dog_llm-0.3.0/tests/test_traceability_ids.py +27 -0
  174. cloud_dog_llm-0.3.0/tests/unit/UT1.10_JSONInTextParser/test_json_text_parser.py +32 -0
  175. cloud_dog_llm-0.3.0/tests/unit/UT1.11_ToolExecutionPipeline/test_tool_pipeline.py +32 -0
  176. cloud_dog_llm-0.3.0/tests/unit/UT1.12_MCPClientStreamableHTTP/test_mcp_streamable.py +32 -0
  177. cloud_dog_llm-0.3.0/tests/unit/UT1.13_MCPClientHTTPJsonRPC/test_mcp_http.py +33 -0
  178. cloud_dog_llm-0.3.0/tests/unit/UT1.14_MCPClientLegacySSE/test_mcp_sse.py +20 -0
  179. cloud_dog_llm-0.3.0/tests/unit/UT1.15_MCPClientStdio/test_mcp_stdio.py +18 -0
  180. cloud_dog_llm-0.3.0/tests/unit/UT1.16_MCPSessionManagement/test_mcp_session.py +33 -0
  181. cloud_dog_llm-0.3.0/tests/unit/UT1.17_A2AClient/test_a2a_client.py +32 -0
  182. cloud_dog_llm-0.3.0/tests/unit/UT1.18_ToolRouter/test_tool_router.py +36 -0
  183. cloud_dog_llm-0.3.0/tests/unit/UT1.19_PromptRegistry/test_prompt_registry.py +32 -0
  184. cloud_dog_llm-0.3.0/tests/unit/UT1.1_OllamaAdapter/test_ollama.py +72 -0
  185. cloud_dog_llm-0.3.0/tests/unit/UT1.20_PromptRendering/test_prompt_render.py +24 -0
  186. cloud_dog_llm-0.3.0/tests/unit/UT1.21_EmbeddingManager/test_embeddings.py +32 -0
  187. cloud_dog_llm-0.3.0/tests/unit/UT1.22_ArtefactStore/test_artefact_store.py +42 -0
  188. cloud_dog_llm-0.3.0/tests/unit/UT1.23_StructuredExtractor/test_structured.py +40 -0
  189. cloud_dog_llm-0.3.0/tests/unit/UT1.24_RepairLoop/test_repair_loop.py +27 -0
  190. cloud_dog_llm-0.3.0/tests/unit/UT1.25_ErrorTaxonomy/test_errors.py +20 -0
  191. cloud_dog_llm-0.3.0/tests/unit/UT1.26_RetryPolicy/test_retries.py +50 -0
  192. cloud_dog_llm-0.3.0/tests/unit/UT1.27_TimeoutManagement/test_timeouts.py +27 -0
  193. cloud_dog_llm-0.3.0/tests/unit/UT1.28_Cancellation/test_cancellation.py +31 -0
  194. cloud_dog_llm-0.3.0/tests/unit/UT1.29_SessionContext/test_session_context.py +23 -0
  195. cloud_dog_llm-0.3.0/tests/unit/UT1.2_OpenAICompatAdapter/test_openai_compat.py +78 -0
  196. cloud_dog_llm-0.3.0/tests/unit/UT1.30_UnifiedResponse/test_response_model.py +59 -0
  197. cloud_dog_llm-0.3.0/tests/unit/UT1.31_ToolOutputReducer/test_output_reducer.py +22 -0
  198. cloud_dog_llm-0.3.0/tests/unit/UT1.32_ParameterPassthrough/test_param_passthrough.py +40 -0
  199. cloud_dog_llm-0.3.0/tests/unit/UT1.33_ResponseShapeCompatibilityAdapter/test_response_adapter.py +102 -0
  200. cloud_dog_llm-0.3.0/tests/unit/UT1.34_ReliabilityMiddlewareHooks/test_reliability_hooks.py +105 -0
  201. cloud_dog_llm-0.3.0/tests/unit/UT1.35_ProviderCapabilityMatrix/test_capability_matrix.py +61 -0
  202. cloud_dog_llm-0.3.0/tests/unit/UT1.36_QueueAwareAvailabilityGating/test_availability_gating.py +41 -0
  203. cloud_dog_llm-0.3.0/tests/unit/UT1.37_DomainFormatterCompatibility/test_formatter_compat.py +46 -0
  204. cloud_dog_llm-0.3.0/tests/unit/UT1.3_OpenRouterAdapter/test_openrouter.py +44 -0
  205. cloud_dog_llm-0.3.0/tests/unit/UT1.4_ProviderRegistry/test_provider_registry.py +49 -0
  206. cloud_dog_llm-0.3.0/tests/unit/UT1.5_ModelRegistry/test_model_registry.py +24 -0
  207. cloud_dog_llm-0.3.0/tests/unit/UT1.6_StreamingEngine/test_streaming.py +31 -0
  208. cloud_dog_llm-0.3.0/tests/unit/UT1.7_StreamingSerialization/test_sse_jsonl.py +25 -0
  209. cloud_dog_llm-0.3.0/tests/unit/UT1.8_ToolDefinitionModel/test_tool_def.py +27 -0
  210. cloud_dog_llm-0.3.0/tests/unit/UT1.9_ToolCallingStyles/test_tool_calling.py +27 -0
  211. cloud_dog_llm-0.3.0/tests/unit/UT_B6_LLMResourceAwareInvocation/test_llm_resource_invocation.py +176 -0
  212. cloud_dog_llm-0.3.0/working/W28A-119-FIX-LLM-REPORT.md +53 -0
@@ -0,0 +1,16 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ .pytest_cache/
8
+ .ruff_cache/
9
+ .coverage
10
+ coverage.xml
11
+ htmlcov/
12
+ working/
13
+ private/
14
+ archive/
15
+ logs/
16
+ *.db
@@ -0,0 +1,213 @@
1
+ # Agent Instruction — Fix cloud_dog_llm (v0.2.0)
2
+
3
+ **Package:** `cloud_dog_llm`
4
+ **Target version:** 0.2.0
5
+ **Date:** 2026-02-18 (updated with full gap analysis)
6
+ **Scope:** 6 new features (FR1.32–FR1.37) + 8 missing SA1 modules — **ALL DELIVERED AND VERIFIED**
7
+
8
+ ---
9
+
10
+ ## Status: ✅ COMPLETE
11
+
12
+ All 6 v0.2.0 features and all 8 previously-missing SA1 modules have been implemented, tested, and verified. This document is retained for reference and future maintenance.
13
+
14
+ **Verified on 2026-02-18:**
15
+ - 86 tests passed (Vault-backed), 0 failed, 0 skipped
16
+ - Lint and format clean (`ruff check` + `ruff format --check`)
17
+ - Build produces `cloud_dog_llm-0.2.0.tar.gz` + `cloud_dog_llm-0.2.0-py3-none-any.whl`
18
+ - All SA1 modules present (plus additional compatibility wrappers)
19
+ - All 59 test directories present and matching TESTS.md
20
+ - Zero config-delegation violations (no `os.environ`/`hvac`/Vault reads for credentials)
21
+
22
+ **Governing documents:**
23
+ 1. `platform-llm/REQUIREMENTS.md` (v0.2.0) — FR1.32–FR1.37
24
+ 2. `platform-llm/ARCHITECTURE.md` (v0.2.0) — SA1 module layout
25
+ 3. `platform-llm/TESTS.md` (v0.2.0) — UT1.33–UT1.37, ST1.7, AT1.5
26
+ 4. `packages/backend/AGENT-INSTRUCTION.md` — Integrity Warranty and Config Delegation — ZERO TOLERANCE (MANDATORY)
27
+
28
+ ---
29
+
30
+ ## Delivery Summary — Previously Missing SA1 Modules (8/8 ✅)
31
+
32
+ | Module | Status | Implementation |
33
+ |--------|--------|---------------|
34
+ | `providers/anthropic.py` | ✅ | Full Anthropic Messages API adapter (163 lines): `/v1/messages`, streaming with `content_block_delta`, health check, capability descriptor |
35
+ | `tools/executor.py` | ✅ | `ToolExecutor` class wrapping `ToolPipeline` for single-call and batch execution |
36
+ | `prompts/template.py` | ✅ | `PromptTemplateVersion` frozen dataclass with `name@version` keying |
37
+ | `structured/parser.py` | ✅ | `parse_structured_payload()` with strict/lenient modes delegating to `extract_json` |
38
+ | `runtime/params.py` | ✅ | `split_provider_params()` separating common from `x_provider.*` scoped keys |
39
+ | `runtime/response.py` | ✅ | `build_response()` helper for constructing unified `LLMResponse` objects |
40
+ | `observability/logging.py` | ✅ | `build_log_payload()` with correlation ID and secret redaction |
41
+ | `security/secrets.py` | ✅ | `contains_secret()` and `redact_payload()` delegating to `security/redaction.py` |
42
+
43
+ ---
44
+
45
+ ## Delivery Summary — v0.2.0 Features (6/6 ✅)
46
+
47
+ ### Issue 1 — Response-Shape Compatibility Adapter ✅ DELIVERED
48
+
49
+ **FR:** FR1.32 | **Tests:** UT1.33, AT1.5
50
+
51
+ - `cloud_dog_llm/compat/response_adapter.py` — `ResponseAdapter` class (152 lines) with per-provider `ProviderMapping` dataclass and dot-path payload extraction
52
+ - Built-in mappings: Ollama, OpenRouter, OpenAI, OpenAI-compat, Anthropic (with content-block array handling)
53
+ - Custom mappings configurable via constructor
54
+ - `ResponseNormalisationError` for unsupported providers or missing content
55
+
56
+ ---
57
+
58
+ ### Issue 2 — Reliability Middleware Hooks ✅ DELIVERED
59
+
60
+ **FR:** FR1.33 | **Tests:** UT1.34, ST1.7
61
+
62
+ - `cloud_dog_llm/middleware/base.py` — `LLMMiddleware` protocol with `pre_request`, `post_response`, `on_error`
63
+ - `cloud_dog_llm/middleware/reliability.py` — `ReliabilityPolicyMiddleware` with:
64
+ - `FixedWindowRateLimiter` (per-key in-memory)
65
+ - `ReliabilityPolicy` (fallback content, append footer)
66
+ - Rate limit enforcement in `pre_request`
67
+ - Response modification in `post_response`
68
+ - Fallback response generation in `on_error`
69
+
70
+ ---
71
+
72
+ ### Issue 3 — MCP Transport Migration Matrix ✅ DELIVERED
73
+
74
+ **FR:** FR1.34
75
+
76
+ - Documentation-only requirement. Transport mapping is implicit in the module layout:
77
+ - stdio → `mcp/transports/stdio.py`
78
+ - Legacy SSE → `mcp/transports/legacy_sse.py`
79
+ - Streamable HTTP → `mcp/transports/streamable_http.py`
80
+ - HTTP JSON-RPC → `mcp/transports/http_jsonrpc.py`
81
+ - **Recommended**: add explicit migration matrix section to ARCHITECTURE.md if needed by projects
82
+
83
+ ---
84
+
85
+ ### Issue 4 — Queue-Aware Availability Gating ✅ DELIVERED
86
+
87
+ **FR:** FR1.35 | **Tests:** UT1.36
88
+
89
+ - `cloud_dog_llm/availability/gating.py` — `QueueAwareAvailabilityGate` (72 lines) with:
90
+ - `AvailabilityState` enum: `AVAILABLE`, `DEGRADED`, `UNAVAILABLE`
91
+ - `AvailabilityStatus` frozen dataclass with queue depth/threshold/rate limit
92
+ - Per-model configurable thresholds
93
+ - Degraded ratio calculation (default 80%)
94
+ - Rate limit integration (zero remaining → unavailable)
95
+
96
+ ---
97
+
98
+ ### Issue 5 — Provider Capability Matrix ✅ DELIVERED
99
+
100
+ **FR:** FR1.36 | **Tests:** UT1.35
101
+
102
+ - `cloud_dog_llm/registry/capabilities.py` — `CapabilityDescriptor` with full fields: `chat`, `tool_calling`, `json_mode`, `embeddings`, `supports_streaming`, `vision`, `max_tokens`, `context_window`
103
+ - Integrated into all provider adapters via `capabilities()` method
104
+ - Used by runtime parameter validation
105
+
106
+ ---
107
+
108
+ ### Issue 6 — Domain Formatter Stack Migration ✅ DELIVERED
109
+
110
+ **FR:** FR1.37 | **Tests:** UT1.37
111
+
112
+ - `cloud_dog_llm/compat/formatter_compat.py` — `FormatterCompatibilityAdapter` (48 lines) with:
113
+ - `wrap()`: wraps formatter callables as `PromptTemplate` instances using `{{compat:name@version}}` markers
114
+ - `render()`: dispatches to registered formatter or standard template rendering
115
+ - `render_chain()`: ordered multi-template rendering
116
+
117
+ ---
118
+
119
+ ## Extra Files (Not in SA1 — Informational)
120
+
121
+ The delivered code includes additional files beyond SA1 that serve as compatibility wrappers or supplementary helpers. These are **not violations** — they are additive:
122
+
123
+ **Compatibility wrappers (delegate to SA1 canonical files):**
124
+ - `runtime/retry.py` → wraps `retries.py` with `RetryPolicy` dataclass
125
+ - `runtime/timeout.py` → wraps `timeouts.py` with `apply_timeout()`
126
+ - `runtime/cancel.py` → wraps `cancellation.py` with `is_cancelled()`
127
+
128
+ **Additional helpers:**
129
+ - `tools/calling.py` — OpenAI-style and JSON-in-text tool-call parsers
130
+ - `tools/schema.py` — Tool schema validation (wraps `schemas.py`)
131
+ - `tools/reducer.py` — Tool output reducer (FR1.28)
132
+ - `tools/executor.py` — `ToolExecutor` wrapper around `ToolPipeline`
133
+ - `config/settings.py`, `config/registry.py` — Runtime settings and config registry
134
+ - `embeddings/providers.py` — Embedding provider helpers
135
+ - `artefacts/models.py`, `artefacts/store.py` — Artefact data models and store factory
136
+ - `structured/schema.py`, `structured/validator.py` — Schema helpers
137
+ - `security/policies.py`, `security/rbac.py`, `security/redaction.py`, `security/secrets.py` — Security utilities
138
+ - `routing/engine.py`, `routing/policies.py` — Routing engine and policies
139
+ - `factory.py` (top-level) — `get_llm_client()` factory imported by `__init__.py`
140
+
141
+ **Recommendation:** Update SA1 in ARCHITECTURE.md to include these files, or consolidate duplicates where appropriate. This is non-blocking — the package is functionally complete.
142
+
143
+ ---
144
+
145
+ ## Verification — Full Suite
146
+
147
+ ```bash
148
+ set -a; source /opt/iac/Development/cloud-dog-ai/env-vault; set +a
149
+ pytest tests --env tests/env-UT --env tests/env-ST --env tests/env-IT --env tests/env-AT -q
150
+ ruff check cloud_dog_llm tests
151
+ ruff format --check cloud_dog_llm tests
152
+ python -m build
153
+ find cloud_dog_llm -name '*.py' -not -path '*__pycache__*' | sort
154
+ ```
155
+
156
+ ## pyproject.toml version
157
+
158
+ ```toml
159
+ version = "0.2.0"
160
+ ```
161
+
162
+ ---
163
+
164
+ ## MANDATORY COMPLETION REPORT
165
+
166
+ When finished, write your report to:
167
+ **`/opt/iac/Development/cloud-dog-ai/cloud-dog-ai-platform-standards/packages/backend/platform-llm/working/W28A-119-FIX-LLM-REPORT.md`**
168
+
169
+ Your report MUST include ALL of the following:
170
+
171
+ ### 1. Run summary
172
+ - List every file changed and what was changed
173
+ - List every module implemented and its purpose
174
+
175
+ ### 2. Test results (REAL counts from actual runs)
176
+ ```
177
+ QT: Xp / Yf
178
+ UT: Xp / Yf
179
+ ST: Xp / Yf
180
+ IT: Xp / Yf
181
+ AT: Xp / Yf
182
+ Ruff: X issues
183
+ ```
184
+
185
+ ### 3. Verdict
186
+ State one of: **PASS** (100% green) / **PARTIAL** (some fixed, some remain) / **FAIL** (no improvement) / **BLOCKED** (cannot proceed)
187
+
188
+ If not PASS, list every remaining failure with classification: `CODE_BUG`, `ENV_CONFIG`, `INFRA_MISSING`, `EXT_SERVICE`
189
+
190
+ ### 4. Evidence logs
191
+ All logs MUST be saved to `working/` directory:
192
+ ```
193
+ working/w28a-119-qt.log
194
+ working/w28a-119-ut.log
195
+ working/w28a-119-st.log
196
+ working/w28a-119-it.log
197
+ working/w28a-119-at.log
198
+ working/w28a-119-ruff.log
199
+ ```
200
+
201
+ ### 5. RULES.md COMPLIANCE WARRANTY
202
+
203
+ Copy this EXACTLY into your report:
204
+ ```
205
+ I warrant that:
206
+ 1. I have read RULES.md IN FULL before starting work
207
+ 2. ALL code I produced is 100% compliant with RULES.md
208
+ 3. ALL test results reported are REAL — exact counts from actual runs
209
+ 4. I have NOT weakened any test
210
+ 5. I have NOT stored, copied, or exposed any credentials
211
+ 6. ALL credentials come from Vault or git-ignored env files
212
+ 7. I have NOT modified files outside this package
213
+ ```
@@ -0,0 +1,69 @@
1
+ # Agent Instruction — Fix platform-llm UT Skips
2
+
3
+ **Package:** `platform-llm`
4
+ **Date:** 2026-02-20
5
+ **Status:** OPEN — HIGH
6
+ **Problem:** 7 UT tests silently skipped out of 86 total.
7
+
8
+ ---
9
+
10
+ ## INTEGRITY WARRANTY
11
+
12
+ All rules from `cloud-dog-ai-platform-standards/RULES.md` apply. Read Sections 1, 2, 5 before any work.
13
+ **"ASK. DON'T GUESS. DON'T LIE. DON'T FUDGE."**
14
+
15
+ ---
16
+
17
+ ## PROBLEM
18
+
19
+ ```
20
+ .venv/bin/pytest tests/ --env tests/env-UT --tb=no -q
21
+ → 79 passed, 7 skipped in 0.70s
22
+ ```
23
+
24
+ 7 tests are skipping. Per RULES.md § 5.3.10-11:
25
+ - `pytest.skip()` is forbidden in IT/AT/QT
26
+ - Skip counts MUST be reported and justified
27
+ - UT tests should NOT skip — they don't depend on external services
28
+
29
+ ---
30
+
31
+ ## FIX
32
+
33
+ ### Step 1 — Identify which tests skip and why
34
+
35
+ ```bash
36
+ cd /opt/iac/Development/cloud-dog-ai/cloud-dog-ai-platform-standards/packages/backend/platform-llm
37
+ .venv/bin/pytest tests/ --env tests/env-UT -v --tb=short 2>&1 | grep -i "skip"
38
+ ```
39
+
40
+ ### Step 2 — For each skipped test, determine the cause
41
+
42
+ - **Missing optional dependency?** → Install it or mark the test correctly
43
+ - **Conditional skip on platform/Python version?** → Document and accept if legitimate
44
+ - **Skip due to missing backend/service?** → If UT, it should NOT require a backend. Fix the test or reclassify it.
45
+ - **`pytest.skip()` in fixture?** → Replace with `pytest.fail()` if the test should be mandatory
46
+
47
+ ### Step 3 — Fix each skip
48
+
49
+ Either:
50
+ - Fix the condition causing the skip (preferred)
51
+ - Reclassify the test to the correct tier (if it genuinely needs an external service)
52
+ - Document the skip with explicit justification (only if unavoidable, e.g. platform-specific)
53
+
54
+ ### Step 4 — Verify
55
+
56
+ ```bash
57
+ .venv/bin/pytest tests/ --env tests/env-UT -v --tb=short 2>&1 | tail -5
58
+ ```
59
+
60
+ **Target:** 86 passed, 0 skipped. If any skips remain, each MUST have documented justification.
61
+
62
+ ---
63
+
64
+ ## COMPLETION GATE
65
+
66
+ 1. Every skipped test investigated and either fixed or justified
67
+ 2. `pytest` output shows pass/fail/skip counts
68
+ 3. Any remaining skips have explicit written justification
69
+ 4. No silent skips — every skip reason visible in test output