Repository navigation
docs(valkey): expand roadmap and add IT domain knowledge base guide - #34
Conversation
…domain exceptions
… complexity across modules
… checks, and error codes
…panded tools, prompts, and resources
…chema export command
…amic index counters
….12 Valkey integration
There was a problem hiding this comment.
🟡 Changes recommended
The new tool timeout implementation in src/devops_cli/ai/agents/runner.py does not actually enforce timeouts due to ThreadPoolExecutor context-manager shutdown behavior, risking hangs in the agent loop.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR expands the DevOps CLI Knowledge Base with a new Valkey reference manual, updates the roadmap/pending-features planning for Valkey-related work, and refreshes documentation/test coverage around Knowledge Base indexing and MCP tooling. It also includes substantial functional code changes (MCP server tool/prompt/resource expansion, domain exception taxonomy additions, and multiple complexity/nesting refactors) that materially increase the PR’s scope beyond “docs(valkey)”.
Changes:
- Add Valkey IT-domain tool manual and register it in the Knowledge Base catalog; regenerate Knowledge Base docs and counts.
- Extend FastMCP surface area (tools, prompts, resources) and add
devops mcp export-schemas; update docs and contract tests accordingly. - Enforce/validate architectural invariants (complexity/nesting + domain exception taxonomy) and refactor multiple hotspots to comply.
File summaries
| File | Description |
|---|---|
| tests/test_rag_embeddings.py | Adds regression test for embeddings provider vector-count mismatch handling. |
| tests/test_pydantic_ai_mcp.py | Tightens MCP discovery expectations (more tools + prompts/resources). |
| tests/test_mcp.py | Adds CLI test for schema export; adds execution coverage for expanded MCP tools/prompts. |
| tests/test_kb.py | Updates Knowledge Base article counts and validates Valkey article presence/loading. |
| tests/test_fastmcp_contracts.py | Expands FastMCP contracts to include additional tools plus prompts/resources. |
| tests/test_docs.py | Validates Valkey appears in generated KB index; tests anyOf-array schema parsing. |
| tests/test_architectural_invariants.py | New invariant test suite for exception taxonomy, nesting/complexity, and banned raises. |
| src/devops_cli/security/vault_broker.py | Replaces bare ValueError with Vault domain exception; refactors KV fetch path. |
| src/devops_cli/security/complexity.py | Extracts finding generation helper to reduce nesting/duplication. |
| src/devops_cli/security/aibom.py | Extracts model metadata parsing helpers and simplifies main extraction loop. |
| src/devops_cli/output/formatters/scalars.py | Extracts repo-map symbol formatting helper for flatter rendering logic. |
| src/devops_cli/lang/en/help.py | Adds help strings for new mcp export-schemas command options. |
| src/devops_cli/k8s/credentials.py | Refactors Grafana password discovery to reduce nesting and duplication. |
| src/devops_cli/k8s/chaos_runner.py | Replaces bare RuntimeError with Kubernetes domain exception. |
| src/devops_cli/exceptions/vault.py | New Vault domain exception taxonomy and error codes. |
| src/devops_cli/exceptions/k8s.py | New Kubernetes domain exception taxonomy and error codes. |
| src/devops_cli/exceptions/docker.py | New Docker domain exception taxonomy and error codes. |
| src/devops_cli/exceptions/ai.py | Adds harness/model-bundling domain exceptions + exports. |
| src/devops_cli/exceptions/init.py | Re-exports newly introduced domain exceptions at package level. |
| src/devops_cli/docs/generator.py | Improves MCP schema type extraction and makes KB article counters dynamic. |
| src/devops_cli/docker/sandbox.py | Replaces bare ValueError with Docker domain exception in workspace validation. |
| src/devops_cli/config/constants.py | Adds new domain error-code constants for vault/k8s/docker/harness/model bundle. |
| src/devops_cli/commands/vault.py | Replaces bare ValueError with VaultConfigurationError for input validation. |
| src/devops_cli/commands/mcp.py | Adds devops mcp export-schemas command to export tool schemas + instructions. |
| src/devops_cli/commands/k8s/cluster_context.py | Replaces bare ValueError with KubernetesContextError for URL/path validation. |
| src/devops_cli/ai/toolsets/init.py | Refactors tool extraction/inspection to helpers and flattens control flow. |
| src/devops_cli/ai/response_repair.py | Extracts JSON tool-call parsing and function-arg parsing helpers. |
| src/devops_cli/ai/rag/embeddings.py | Makes embeddings errors DevOpsCLIError-derived; refactors probing and embed dispatch. |
| src/devops_cli/ai/providers/init.py | Table-drives native provider selection and base_url injection rules. |
| src/devops_cli/ai/model_bundler.py | Replaces bare ValueError with ModelBundleError for output path validation. |
| src/devops_cli/ai/mcp/server.py | Adds many new MCP tools plus resources/prompts for expanded automation surface. |
| src/devops_cli/ai/mcp/init.py | Re-exports expanded MCP tools/resources/prompts/types for external consumers. |
| src/devops_cli/ai/knowledge_base/README.md | Registers Valkey in Division 2 tool reference table. |
| src/devops_cli/ai/knowledge_base/it_domains/tools/valkey.md | New Valkey IT-domain technical manual. |
| src/devops_cli/ai/harness/workflow.py | Replaces bare exceptions with harness domain exceptions; improves validation semantics. |
| src/devops_cli/ai/harness/skills.py | Replaces bare exceptions with harness validation exceptions during skill parsing/validation. |
| src/devops_cli/ai/harness/shell.py | Replaces bare exceptions with harness validation exception for option validation. |
| src/devops_cli/ai/harness/planning.py | Replaces bare exceptions with harness validation exceptions for subtask/tool validation. |
| src/devops_cli/ai/harness/os_access.py | Replaces bare RuntimeError with HarnessExecutionError for nested tool budget overflow. |
| src/devops_cli/ai/harness/memory.py | Moves conflict error under harness execution taxonomy; replaces bare ValueError with harness validation exceptions. |
| src/devops_cli/ai/harness/filesystem.py | Major refactor: extracts FileSystem tool closures into methods to reduce complexity. |
| src/devops_cli/ai/harness/compaction.py | Replaces bare ValueError with HarnessValidationError for config validation. |
| src/devops_cli/ai/durable.py | Replaces bare ValueError with HarnessValidationError for db_path traversal protection. |
| src/devops_cli/ai/benchmark/embedding_tasks.py | Extracts eval-pair parsing helper for flatter parsing logic. |
| src/devops_cli/ai/ast_stream.py | Extracts AST/token helpers to reduce nesting and centralize node/token handling. |
| src/devops_cli/ai/analyze/scanner.py | Extracts per-line dependency parsing helpers and consolidates language handling. |
| src/devops_cli/ai/agents/testing.py | Sets __test__ = False to prevent pytest collecting mock model as a test. |
| src/devops_cli/ai/agents/runner.py | Refactors tool-execution hook/timeout handling into helpers. |
| src/devops_cli/ai/agents/agent.py | Extracts toolset-instruction and tool-description formatting helpers for prompt building. |
| README.md | Adds devops mcp export-schemas to the command matrix. |
| docs/ROADMAP.md | Adds/updates roadmap milestones covering Valkey and MCP ecosystem expansion. |
| docs/PENDING_FEATURES.md | Updates active milestone framing + adds v0.2.12 Valkey items. |
| docs/MCP_TOOLS.md | Regenerates MCP tools doc to include new tools and their parameter tables. |
| docs/LOG.md | Adds log entries documenting Valkey investigation and MCP/tooling/exception taxonomy work. |
| docs/KNOWLEDGE_BASE.md | Regenerates KB catalog counts and includes Valkey tool entry. |
| docs/ERRORS.md | Documents newly introduced domain error codes and their semantics. |
| docs/commands/mcp.md | Documents the new devops mcp export-schemas command. |
| docs/CLI_REFERENCE.md | Includes the new mcp export-schemas command in the full CLI reference. |
| docs/agent/task.md | Updates task tracking to include the Valkey investigation/PR work. |
| AGENTS.md | Tightens and clarifies complexity/nesting + exception taxonomy invariants. |
Review details
- Files reviewed: 60/60 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…oadmap-and-knowledge-base
…b management (#38) * feat(k8s): replace redis with valkey across cluster stack manifests (#31) * feat(k8s): replace redis with valkey across cluster stack manifests * test(k8s): address copilot feedback on manifest parsing and document assertions * docs(agent): update task tracking to completed for phase 35 * feat(mcp): expand FastMCP tools, prompt templates, and schema export (#33) * refactor(exceptions): define domain exception classes and canonical error codes * test(invariants): author architectural and stylistic invariant test specifications * fix(exceptions): replace bare generic exceptions with strongly typed domain exceptions * refactor(complexity): flatten excessive nesting and reduce cyclomatic complexity across modules * fix(test-hygiene): eliminate pytest collection warning and unawaited coroutines * docs(standards): update architectural guidelines, task tracking, and roadmap * docs(agent): update task tracking to monitor PR 32 CI * fix(review): address copilot feedback on vector validation, invariant checks, and error codes * test(mcp): author contract and integration test specifications for expanded tools, prompts, and resources * feat(mcp): expand FastMCP server to 72 tools, prompt templates, and schema export command * docs(mcp): update MCP_TOOLS, README, ROADMAP, and task tracking for phase 37 * fix(mcp): resolve schema union type parsing and update roadmap resource URIs * refactor(architecture): codebase stylistic and structural drift remediation (#32) * refactor(exceptions): define domain exception classes and canonical error codes * test(invariants): author architectural and stylistic invariant test specifications * fix(exceptions): replace bare generic exceptions with strongly typed domain exceptions * refactor(complexity): flatten excessive nesting and reduce cyclomatic complexity across modules * fix(test-hygiene): eliminate pytest collection warning and unawaited coroutines * docs(standards): update architectural guidelines, task tracking, and roadmap * docs(agent): update task tracking to monitor PR 32 CI * fix(review): address copilot feedback on vector validation, invariant checks, and error codes * fix(agents): prevent ThreadPoolExecutor blocking on tool timeout in runner * docs(valkey): expand roadmap and add IT domain knowledge base guide (#34) * refactor(exceptions): define domain exception classes and canonical error codes * test(invariants): author architectural and stylistic invariant test specifications * fix(exceptions): replace bare generic exceptions with strongly typed domain exceptions * refactor(complexity): flatten excessive nesting and reduce cyclomatic complexity across modules * fix(test-hygiene): eliminate pytest collection warning and unawaited coroutines * docs(standards): update architectural guidelines, task tracking, and roadmap * docs(agent): update task tracking to monitor PR 32 CI * fix(review): address copilot feedback on vector validation, invariant checks, and error codes * test(mcp): author contract and integration test specifications for expanded tools, prompts, and resources * feat(mcp): expand FastMCP server to 72 tools, prompt templates, and schema export command * docs(mcp): update MCP_TOOLS, README, ROADMAP, and task tracking for phase 37 * fix(mcp): resolve schema union type parsing and update roadmap resource URIs * feat(kb): add Valkey IT domain knowledge base reference guide and dynamic index counters * docs(roadmap): expand roadmap and pending features for milestone v0.2.12 Valkey integration * fix(agents): prevent ThreadPoolExecutor blocking on tool timeout in runner * docs(roadmap): add library ingestion engine and grounded AI guidance for v0.2.13 (#35) * refactor(exceptions): define domain exception classes and canonical error codes * test(invariants): author architectural and stylistic invariant test specifications * fix(exceptions): replace bare generic exceptions with strongly typed domain exceptions * refactor(complexity): flatten excessive nesting and reduce cyclomatic complexity across modules * fix(test-hygiene): eliminate pytest collection warning and unawaited coroutines * docs(standards): update architectural guidelines, task tracking, and roadmap * docs(agent): update task tracking to monitor PR 32 CI * fix(review): address copilot feedback on vector validation, invariant checks, and error codes * test(mcp): author contract and integration test specifications for expanded tools, prompts, and resources * feat(mcp): expand FastMCP server to 72 tools, prompt templates, and schema export command * docs(mcp): update MCP_TOOLS, README, ROADMAP, and task tracking for phase 37 * fix(mcp): resolve schema union type parsing and update roadmap resource URIs * feat(kb): add Valkey IT domain knowledge base reference guide and dynamic index counters * docs(roadmap): expand roadmap and pending features for milestone v0.2.12 Valkey integration * docs(roadmap): expand roadmap and pending features for milestone v0.2.13 library ingestion engine * fix(mcp): validate integer argument bounds and ensure consistent export-schemas instructions output * docs(agent): update task tracking for phase 39 completion and pr 35 review resolution * fix(agents): prevent ThreadPoolExecutor blocking on tool timeout in runner * feat(sdlc): enterprise SDLC conventions, repository governance, and GitHub automation roadmap (#36) * feat(governance): establish enterprise SDLC repository templates and community health policies * docs(sdlc): author enterprise software development life cycle architecture manual * docs(roadmap): expand roadmap with v0.2.14 enterprise GitHub repository automation * docs(agent): track phase 40 completion and PR 36 submission * fix(review): address copilot feedback on private key exclusion, PR template, and task status * feat(review): executive summary reporting, feedback loop hardening, and findings remediation (#37) * fix(security): remediate review findings for traversal, protocols, and tool validation * feat(review): harden self-improvement feedback loop and add report executive summary * docs(review): synchronize review task manual, SDLC, and working log * docs(agent): mark phase 41 complete and record PR 37 status * fix(review): address copilot feedback on secret masking, AST symbol fallback, error message, and dynamic patterns * docs(agent): note PR 36 merged into release branch * docs(roadmap): update v0.2.11 completed items and task tracking for merged PR 37 * test * feat(github): add declarative labels, milestones, projects v2, views and FastMCP tools * refactor(core): consolidate boilerplate decorators, AST cache, scanners, and table builder * feat(security): DevSecOps zero-trust hardening, secret sanitizer, fail-closed SSRF, sandbox isolation, and K8s perimeter * fix(review): address Copilot findings for Checkov exit handling, milestone due_on, gitleaks Windows paths, and symlink semantics * docs(release): record Phase 47.3 release v0.2.11 PR and Copilot remediation in task tracking and log
Summary & Motivation
Investigates Valkey integration opportunities across the DevOps CLI ecosystem following the Valkey 8.0 migration, schedules Milestone
v0.2.12for workstation Valkey management and distributed AI caching, and authors a comprehensive IT domain technical manual in the bundled Knowledge Base.Key Changes
src/devops_cli/ai/knowledge_base/it_domains/tools/valkey.mdcovering Valkey 8.0 architecture, RESP3 protocol compatibility, memory optimization, eviction policies, async Python integration (valkey-py), and zero-trust security guidelines.src/devops_cli/ai/knowledge_base/README.md.generate_knowledge_base_indexinsrc/devops_cli/docs/generator.pyto use dynamic counters fromKnowledgeBaseStats(stats.topics_countandstats.tools_count) instead of hardcoded numbers.docs/KNOWLEDGE_BASE.md(now tracking 79 operational manuals: 40 IT domain, 29 tools, 11 topics).v0.2.12indocs/ROADMAP.mdanddocs/PENDING_FEATURES.md:devops valkeyworkstation management CLI (ping,info,stats,keys,get,set,flush,cli,backup,restore).ai.cache.backend=valkey) for RAG embeddings and AST review findings.valkey_ping,valkey_info,valkey_get,valkey_set,valkey_keys,valkey_flush, andresource://valkey/status).docs/ROADMAP.md.tests/test_kb.pyandtests/test_docs.pyverifying article loading, index generation, and article counts.devops ci— 10/10 quality gates passed with