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.
- cloud_dog_llm-0.3.0/.gitignore +16 -0
- cloud_dog_llm-0.3.0/AGENT-INSTRUCTION-FIX-LLM.md +213 -0
- cloud_dog_llm-0.3.0/AGENT-INSTRUCTION-FIX-UT-SKIPS.md +69 -0
- cloud_dog_llm-0.3.0/ARCHITECTURE.md +504 -0
- cloud_dog_llm-0.3.0/BUILD.md +74 -0
- cloud_dog_llm-0.3.0/CHANGELOG.md +6 -0
- cloud_dog_llm-0.3.0/LICENCE +190 -0
- cloud_dog_llm-0.3.0/LICENSE +176 -0
- cloud_dog_llm-0.3.0/MCP-MIGRATION.md +17 -0
- cloud_dog_llm-0.3.0/NOTICE +7 -0
- cloud_dog_llm-0.3.0/PKG-INFO +33 -0
- cloud_dog_llm-0.3.0/README.md +87 -0
- cloud_dog_llm-0.3.0/REQUIREMENTS.md +343 -0
- cloud_dog_llm-0.3.0/TESTS.md +303 -0
- cloud_dog_llm-0.3.0/adoption_test.py +74 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/__init__.py +38 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/a2a/__init__.py +20 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/a2a/client.py +41 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/a2a/envelope.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/__init__.py +30 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/base.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/local.py +62 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/memory.py +37 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/models.py +22 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/s3.py +35 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/artefacts/store.py +75 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/availability/__init__.py +19 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/availability/gating.py +91 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/compat/__init__.py +20 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/compat/formatter_compat.py +64 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/compat/response_adapter.py +167 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/config/__init__.py +15 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/config/models.py +44 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/config/registry.py +56 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/config/settings.py +41 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/domain/__init__.py +15 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/domain/enums.py +47 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/domain/errors.py +69 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/domain/models.py +87 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/__init__.py +22 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/base.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/manager.py +35 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/ollama.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/openai_compat.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/embeddings/providers.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/factory.py +89 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/__init__.py +21 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/client.py +69 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/fastmcp.py +31 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/session.py +30 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transport.py +36 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/http_jsonrpc.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/legacy_sse.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/stdio.py +28 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/mcp/transports/streamable_http.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/middleware/__init__.py +31 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/middleware/base.py +99 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/middleware/reliability.py +117 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/multimodal/__init__.py +21 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/multimodal/handler.py +65 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/multimodal/models.py +46 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/observability/__init__.py +23 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/observability/audit.py +30 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/observability/logging.py +34 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/observability/metrics.py +51 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/observability/otel.py +40 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/observability/redaction.py +38 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/__init__.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/registry.py +45 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/render.py +39 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/prompts/template.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/__init__.py +33 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/anthropic.py +180 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/base.py +48 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/factory.py +49 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/ollama.py +173 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/openai.py +32 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/openai_compat.py +195 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/openrouter.py +39 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/providers/registry.py +44 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/registry/__init__.py +15 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/registry/capabilities.py +43 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/registry/registry.py +67 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/routing/__init__.py +20 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/routing/engine.py +51 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/routing/policies.py +41 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/__init__.py +40 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/cancel.py +28 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/cancellation.py +39 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/client.py +89 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/job_invoker.py +117 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/params.py +36 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/response.py +46 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/retries.py +51 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/retry.py +46 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/session.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/streaming.py +78 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/timeout.py +30 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/runtime/timeouts.py +29 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/__init__.py +30 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/governance.py +30 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/policies.py +51 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/rbac.py +41 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/redaction.py +34 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/secrets.py +38 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/security/tools_policy.py +32 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/__init__.py +31 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/extractor.py +34 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/parser.py +32 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/reducer.py +28 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/repair.py +42 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/schema.py +43 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/structured/validator.py +38 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/testing/__init__.py +22 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/testing/conformance.py +29 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/testing/fixtures.py +35 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/testing/mock_providers.py +43 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/testing/vcr.py +79 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/__init__.py +38 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/calling.py +89 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/executor.py +43 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/local.py +36 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/models.py +51 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/parser.py +34 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/pipeline.py +83 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/reducer.py +41 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/router.py +55 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/schema.py +38 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/tools/schemas.py +27 -0
- cloud_dog_llm-0.3.0/cloud_dog_llm/traceability_ids.py +63 -0
- cloud_dog_llm-0.3.0/defaults.yaml +65 -0
- cloud_dog_llm-0.3.0/docs/ARCHITECTURE.md +17 -0
- cloud_dog_llm-0.3.0/docs/CONFIGURATION.md +16 -0
- cloud_dog_llm-0.3.0/docs/EXAMPLES.md +10 -0
- cloud_dog_llm-0.3.0/pyproject.toml +44 -0
- cloud_dog_llm-0.3.0/scaffold/cloud_dog_llm/__init__.py +32 -0
- cloud_dog_llm-0.3.0/scaffold/defaults.yaml +65 -0
- cloud_dog_llm-0.3.0/scaffold/pyproject.toml +29 -0
- cloud_dog_llm-0.3.0/scaffold/tests/conftest.py +73 -0
- cloud_dog_llm-0.3.0/tests/__init__.py +13 -0
- cloud_dog_llm-0.3.0/tests/application/AT1.1_ServiceStartupPattern/test_service_startup.py +83 -0
- cloud_dog_llm-0.3.0/tests/application/AT1.2_ChatWithToolCalling/test_chat_tools.py +36 -0
- cloud_dog_llm-0.3.0/tests/application/AT1.3_MCPAllTransports/test_mcp_transports.py +38 -0
- cloud_dog_llm-0.3.0/tests/application/AT1.4_ConformanceSuite/test_conformance.py +39 -0
- cloud_dog_llm-0.3.0/tests/application/AT1.5_ResponseAdapterIntegration/test_response_adapter_integration.py +65 -0
- cloud_dog_llm-0.3.0/tests/conftest.py +97 -0
- cloud_dog_llm-0.3.0/tests/env-AT +2 -0
- cloud_dog_llm-0.3.0/tests/env-IT +3 -0
- cloud_dog_llm-0.3.0/tests/env-ST +2 -0
- cloud_dog_llm-0.3.0/tests/env-UT +2 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.1_OllamaChat/test_ollama_chat.py +72 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.2_OllamaStream/test_ollama_stream.py +75 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.3_OllamaEmbeddings/test_ollama_embed.py +66 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.4_OpenRouterChat/test_openrouter_chat.py +88 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.5_MCPServerIntegration/test_mcp_server.py +43 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.6_ToolCallingRealLLM/test_tool_calling_real.py +70 -0
- cloud_dog_llm-0.3.0/tests/integration/IT1.7_MultiProviderBackend/test_multi_backend.py +86 -0
- cloud_dog_llm-0.3.0/tests/integration/__init__.py +13 -0
- cloud_dog_llm-0.3.0/tests/integration/vault_models.py +76 -0
- cloud_dog_llm-0.3.0/tests/quality/QT_PUBLISH_COMPLIANCE/__init__.py +2 -0
- cloud_dog_llm-0.3.0/tests/quality/QT_PUBLISH_COMPLIANCE/test_publish_compliance.py +58 -0
- cloud_dog_llm-0.3.0/tests/quality/__init__.py +2 -0
- cloud_dog_llm-0.3.0/tests/security/QT1.1_SecretRedaction/test_secret_redaction.py +30 -0
- cloud_dog_llm-0.3.0/tests/security/QT1.2_GovernancePolicies/test_governance.py +49 -0
- cloud_dog_llm-0.3.0/tests/security/QT1.3_ToolAccessPolicies/test_tool_policies.py +33 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.1_ChatEndToEnd/test_chat_e2e.py +51 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.2_StreamEndToEnd/test_stream_e2e.py +52 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.3_ToolCallEndToEnd/test_tool_call_e2e.py +35 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.4_MCPToolCallEndToEnd/test_mcp_tool_e2e.py +40 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.5_PromptRenderToChat/test_prompt_to_chat.py +55 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.6_MultiProviderSwitch/test_multi_provider.py +65 -0
- cloud_dog_llm-0.3.0/tests/system/ST1.7_ReliabilityMiddlewareEndToEnd/test_reliability_e2e.py +68 -0
- cloud_dog_llm-0.3.0/tests/test_traceability_ids.py +27 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.10_JSONInTextParser/test_json_text_parser.py +32 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.11_ToolExecutionPipeline/test_tool_pipeline.py +32 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.12_MCPClientStreamableHTTP/test_mcp_streamable.py +32 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.13_MCPClientHTTPJsonRPC/test_mcp_http.py +33 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.14_MCPClientLegacySSE/test_mcp_sse.py +20 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.15_MCPClientStdio/test_mcp_stdio.py +18 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.16_MCPSessionManagement/test_mcp_session.py +33 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.17_A2AClient/test_a2a_client.py +32 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.18_ToolRouter/test_tool_router.py +36 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.19_PromptRegistry/test_prompt_registry.py +32 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.1_OllamaAdapter/test_ollama.py +72 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.20_PromptRendering/test_prompt_render.py +24 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.21_EmbeddingManager/test_embeddings.py +32 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.22_ArtefactStore/test_artefact_store.py +42 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.23_StructuredExtractor/test_structured.py +40 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.24_RepairLoop/test_repair_loop.py +27 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.25_ErrorTaxonomy/test_errors.py +20 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.26_RetryPolicy/test_retries.py +50 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.27_TimeoutManagement/test_timeouts.py +27 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.28_Cancellation/test_cancellation.py +31 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.29_SessionContext/test_session_context.py +23 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.2_OpenAICompatAdapter/test_openai_compat.py +78 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.30_UnifiedResponse/test_response_model.py +59 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.31_ToolOutputReducer/test_output_reducer.py +22 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.32_ParameterPassthrough/test_param_passthrough.py +40 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.33_ResponseShapeCompatibilityAdapter/test_response_adapter.py +102 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.34_ReliabilityMiddlewareHooks/test_reliability_hooks.py +105 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.35_ProviderCapabilityMatrix/test_capability_matrix.py +61 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.36_QueueAwareAvailabilityGating/test_availability_gating.py +41 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.37_DomainFormatterCompatibility/test_formatter_compat.py +46 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.3_OpenRouterAdapter/test_openrouter.py +44 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.4_ProviderRegistry/test_provider_registry.py +49 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.5_ModelRegistry/test_model_registry.py +24 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.6_StreamingEngine/test_streaming.py +31 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.7_StreamingSerialization/test_sse_jsonl.py +25 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.8_ToolDefinitionModel/test_tool_def.py +27 -0
- cloud_dog_llm-0.3.0/tests/unit/UT1.9_ToolCallingStyles/test_tool_calling.py +27 -0
- cloud_dog_llm-0.3.0/tests/unit/UT_B6_LLMResourceAwareInvocation/test_llm_resource_invocation.py +176 -0
- cloud_dog_llm-0.3.0/working/W28A-119-FIX-LLM-REPORT.md +53 -0
|
@@ -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
|