Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- STATUS and READY match `kubectl get pods` wherever pods are listed: the dashboard, `devops dashboard --summary`, `devops k8s pods` and `--watch`. The Kubernetes tab's banner names the context, the Ready nodes and the unhealthy pods, or the context and the real error when it cannot connect (#686).
- Namespace and text filters survive refreshes and keep the highlighted pod on screen. Logs follow a pod's default container, `c` cycles containers, a replaced log stream is closed, and `e` opens the pod's containers and recent events. The Minikube probe is gone (#686).

### Changed
- **MCP Tool `k8s_chaos` Previews by Default**:
- `experiment` is the positional argument, and a new `dry_run` parameter (default `true`) passes `--dry-run`, so the tool runs an experiment only when `dry_run` is false (#836).

### Removed
- **LightLLM Inference Backend (`devops_cli.ai`, `k8s/llm`)**:
- Fully removed the unused `ghcr.io/modeltc/lightllm` inference backend, including `k8s/llm/lightllm/` manifests, `CONST_AI_BACKEND_LIGHTLLM`, `GatewayRouter.scale_lightllm()`, the `devops-cli-ai_lightllm_scale` MCP tool, and all associated CLI, configuration, and test references. The `devops ai gateway scale` command now exclusively targets the vLLM backend.
- **MCP Tools and Parameters With No Command Behind Them**:
- The `ai_architecture` tool, which called a nonexistent `devops analyze architecture`, and the parameters `repos_sync(all_repos)`, `k8s_audit(namespace)` and `k8s_chaos(action)`, which their commands never took (#836).

### Fixed
- **Kubernetes Monitoring Stack Integration & Dashboard Metrics (`k8s/monitoring`)**:
Expand Down Expand Up @@ -69,6 +75,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Tests Never Reach Port-Forwarded Services (`tests/conftest.py`)**:
- The test network guard refuses loopback connects to any port the test process is not listening on, and a port refuses again once its listener closes, so a workstation's port-forwards (OTLP collector, Valkey, Ollama, ArgoCD) are never reached by the suite; one run had made 5,716 such connects. The refusal is the `ConnectionRefusedError` clients already handle (#837).
- `EmbeddingsEngine` no longer skips its Valkey probe under pytest, and `test_popeye_dry_run` no longer runs the real popeye binary (#837).
- **MCP Tools Call Commands That Exist (`devops mcp`, `devops docs check`)**:
- Twelve MCP entry points called commands or options the CLI does not have and failed on every call. They now call real commands: `benchmark_embeddings` and `benchmark_suite` run `devops ai benchmark`; `scan_gitleaks`, `scan_semgrep` and `scan_checkov` run `devops scan secrets`, `sast` and `iac`; `resource://workspace/status` runs `devops repos list`; `scan_complexity` passes `--max-indent`; `resource://argo/fleet/status` no longer passes `--json` (#836).
- `devops docs check` resolves every `uv run devops` argv in the MCP server against the real command tree without running it, and reports each defect at its server line (#836).

## [0.2.24] - 2026-09-28

Expand Down
26 changes: 3 additions & 23 deletions docs/MCP_TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ The `devops-cli` FastMCP server exposes DevOps automation and AI review capabili

| Tool Name | Description |
|---|---|
| [`ai_architecture`](#ai-architecture) | Analyze architectural module boundaries, dependency graphs, and cyclic imports. |
| [`ai_ast_graph`](#ai-ast-graph) | Synthesize whole-repository code symbol and reference graph across polyglot languages. |
| [`ai_ast_parse`](#ai-ast-parse) | Parse a polyglot source file (Python, TypeScript, JavaScript, Go, Rust, Java, C#, C, C++, HCL, shell, Markdown) into syntax symbols or execute S-expression query. |
| [`ai_backend_probe`](#ai-backend-probe) | Directly probe health, latency, and registered models of an inference backend. |
Expand Down Expand Up @@ -170,17 +169,6 @@ Pass the domain name alone, for example `k8s`. |

---

### `ai_architecture`

Analyze architectural module boundaries, dependency graphs, and cyclic imports.

**Parameters:**

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `target` | `string` | No | `src` | - |
| `max_depth` | `integer` | No | `4` | - |

### `ai_ast_graph`

Synthesize whole-repository code symbol and reference graph across polyglot languages.
Expand Down Expand Up @@ -952,11 +940,7 @@ Pass the domain name alone, for example `k8s`.

Audit Kubernetes cluster security posture, RBAC policies, and CIS benchmarks.

**Parameters:**

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `namespace` | `string` | No | `default` | - |
*No parameters required.*

### `k8s_bootstrap`

Expand All @@ -976,9 +960,9 @@ Inject or validate Kubernetes chaos engineering experiments and cluster resilien

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `action` | `string` | No | `validate` | - |
| `experiment` | `string` | No | `pod-failure` | - |
| `namespace` | `string` | No | `default` | - |
| `dry_run` | `boolean` | No | `True` | - |

### `k8s_create_tls_secret`

Expand Down Expand Up @@ -1346,11 +1330,7 @@ Display uncommitted changes and branch drift across workspace repositories.

Fetch and pull tracking branches across workspace repositories.

**Parameters:**

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `all_repos` | `boolean` | No | `False` | - |
*No parameters required.*

### `review_branch`

Expand Down
10 changes: 4 additions & 6 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -1034,12 +1034,10 @@ High-density product roadmap, engineering milestones, and open-source integratio
- *Constraint*: A parser written for one agent's schema reads another's transcripts as steps with no source or tools and reports a passing error rate (Measured). Character counts cannot estimate thinking tokens, because most stored thinking blocks are empty. Native data carries `session.id`, `user.id`, `organization.id` and, when available, `user.email`: an `attributes` delete processor must strip identity fields before any exporter, with `OTEL_LOG_TOOL_DETAILS` and `OTEL_LOG_USER_PROMPTS` unset. Prometheus and Loki keep 2h (`k8s/monitoring/prometheus-values.yaml:11`), so the dashboard shows recent sessions, not trends; report values without thresholds.
- *Measured*: Snapshot of live, growing transcripts on 2026-09-25. `python3 -B probe/t89/vibes_on_cc.py` ran vibes `TrajectoryParser` and `TelemetryCalculator` over this project's Claude Code transcripts and printed error_rate 0.0. `python3 -B probe/t89/measure.py` over the same files printed 53 of 2788 tool results flagged `is_error`, 1,338,604 recorded thinking tokens, and 1923 of 2809 thinking blocks with empty text.
- *Source*: vibes `tools/conversation_synthesizer.py`
- [ ] **MCP Tools Resolve to Real Commands; Whole-Tree Import-Cycle Invariant (P0 - Critical)**:
- *Context & Rationale*: Three MCP tools shell out to commands that do not exist. `ai_architecture` runs `devops analyze architecture` (`src/devops_cli/ai/mcp/server.py:2135-2151`), and `benchmark_embeddings` and `benchmark_suite` run a top-level `devops benchmark` (`server.py:2078-2131`). `docs/MCP_TOOLS.md:9` still advertises cyclic-import analysis, and `tests/test_mcp.py:400` passes only because `_run_mcp_cmd` is mocked. The only cycle check is a hand-rolled Tarjan over four subsystems (`tests/test_architectural_invariants.py:282-347`), which runs inside the pytest step of `devops ci` (`src/devops_cli/commands/ci.py:303`). Its walker uses `ast.walk` (`:275`), so function-scope and `TYPE_CHECKING` imports count as edges. Of vibes' SGM001-SGM005, `mypy --strict` (`.github/workflows/ci.yml:57`) already covers SGM001/SGM002, and SGM003 (cycles) is the real gap. Nothing enforces AGENTS.md:84's ban on obsolete shims. `devops ci` has no dead-code step, and vulture sits in `.venv` but appears in neither `pyproject.toml` nor `uv.lock`.
- *Deliverable*: Measure before enforcing. (1) A contract test resolves every `uv run devops` argv list in `ai/mcp/server.py` against `typer.main.get_command(app)` with no subprocess mock, reusing T01's resolver once it lands. Repoint `benchmark_suite` to `devops ai benchmark --suite`, fix or delete the other two tools, and update `docs/MCP_TOOLS.md`. (2) Move the test's import resolver into `core/import_graph.py`, keep only module-level imports outside `if TYPE_CHECKING:`, widen the check to all of `src/devops_cli`, and replace the Tarjan with stdlib `graphlib.TopologicalSorter(graph).prepare()`, whose `CycleError` names a cycle. Add vibes' `from pkg import b` fixture and a deferred-import fixture. (3) Only then back `ai_architecture` with that seam, reporting import-time and function-scope cycles separately. (4) Add vulture as a dev dependency with `[tool.vulture]` `ignore_decorators` for Typer, MCP and Pydantic, and run it as an advisory `devops ci` step that never fails. Whitelist only the residue, leave unused arguments to Ruff `ARG`, and delete confirmed dead constants. Port nothing from `code_memory.py`.
- *Constraint*: A gate that counts function-scope imports starts red on a component that is not an import-time cycle. Drawing both package and submodule edges for `from pkg import b`, as vibes does, flags `ai.client` against `ai.client.unified`, which CPython imports cleanly. grimp's `is_lazy` marks only `lazy import` syntax, and an import-linter `acyclic_siblings` contract already breaks, so neither import-linter nor pylint R0401 earns a dependency. Unconfigured vulture rates almost everything at 60% and proposes deleting Typer commands and MCP tools. `grep` each residue hit before deleting it, because `getattr` and string lookups hide references. Add no caller or blast-radius column (SGM005). vibes' oracle reports zero for every symbol, and a zero reads as safe to change. Ratcheting belongs to `devops scan baseline`.
- *Measured*: `python probe/value435/mcp_argv.py`: 3 of 170 `devops` argv lists in `server.py` resolve to no command. `python probe/cycles_grimp_like.py toplevel` (module-level, non-`TYPE_CHECKING` imports): 0 non-trivial SCCs. `python probe/cycles_grimp_like.py all` (every import node): largest SCC 102 modules. `vulture src/devops_cli --min-confidence 60 | wc -l`: 1624 findings before any decorator is ignored.
- *Source*: vibes `tools/code_memory.py`, vibes `observations/systems/26-semantic-graph-ast-code-memory-and-persistent-symbol-indexing.md`, vibes `docs/ROADMAP.md`, vibes `examples/code-smell-quantifier/smell_quantifier.py`, vibes `examples/code-smell-quantifier/test_smell_quantifier.py`, vibes `examples/code-smell-quantifier/README.md`
- [x] **MCP Tools Resolve to Real Commands; Whole-Tree Import-Cycle Invariant (P0 - Critical, Issue #836)**:
- *Context & Rationale*: 12 of the 169 `uv run devops` argv lists in the MCP server called commands or options the CLI never had (`devops benchmark`, `analyze architecture`, the scan aliases, `repos sync --all` and others), so those tools failed on every call; each was broken when it was added, and the tests mocked the runner.
- *Deliverable*: Every broken argv now calls a real command, or the tool or parameter that had nothing behind it is removed (`ai_architecture`; `repos_sync(all_repos)`, `k8s_audit(namespace)`, `k8s_chaos(action)`), and `k8s_chaos` previews by default. `devops docs check` resolves every MCP argv statically against the real command tree, without running anything, and reports each defect by server line. The whole-tree import-cycle half is #848; the vulture step is dropped.
- *Constraint*: Critical fix: a P0 defect fix admitted to the current release by the owner. A bare `["devops", ...]` argv outside the MCP server (`commands/devcontainer.py:964`) is a follow-up.
- [x] **Loopback Socket Guard So Tests Never Reach Port-Forwarded Services (P0 - Critical, Issue #837)**:
- *Context & Rationale*: The test network guard refused external hosts but let every loopback connect through, so a workstation's kubectl port-forwards were live test dependencies: one suite run made 5,716 loopback connects (5,562 to the OTLP collector, 80 to Valkey, 29 to Ollama).
- *Deliverable*: The guard refuses a loopback connect to any port the test process is not itself listening on, with the `ConnectionRefusedError` clients already handle, and a port refuses again once its listener closes. With stand-ins listening on the usual ports, a full suite run reaches none of them (5,736 refused, 21 to in-process servers). The guard stays installed after the session, `EmbeddingsEngine` no longer skips its Valkey probe under pytest, and `test_popeye_dry_run` no longer runs the real popeye binary.
Expand Down
Loading
Loading