Skip to content

feat(mcp): declare ToolAnnotations readOnlyHint on all tools and default tf_apply auto_approve=False - #1600

Merged
dan-petty merged 1 commit into
release/v0.2.36from
feat/857-mcp-tool-annotations
Oct 16, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.36from
feat/857-mcp-tool-annotations

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Closes #857

  • Annotates all 155 registered FastMCP tools in src/devops_cli/ai/mcp/server.py with annotations={"readOnlyHint": True} or annotations={"readOnlyHint": False}, classifying argument-dependent mutating tools (roadmap_render, gh_project_reconcile, docker_sign, argo_rollout_analyze, rag_drift, review_pr, gh_label_sync, etc.) as readOnlyHint: False.
  • Changes tf_apply in src/devops_cli/ai/mcp/server.py to default to auto_approve=False.
  • Carries read_only_hint (readOnlyHint) into MCPToolInfo (src/devops_cli/models/ai.py), devops mcp export-schemas (src/devops_cli/commands/mcp.py), MCPToolDoc (src/devops_cli/docs/generator.py), and regenerated docs/MCP_TOOLS.md.
  • Adds test_fastmcp_tool_annotations_and_mutating_floor in tests/test_fastmcp_contracts.py and updates tests/test_mcp.py.

Verification

  • uv run devops docs check
  • uv run pytest tests/test_fastmcp_contracts.py tests/test_mcp.py tests/test_docs.py
  • DEVOPS_CLI_HEADLESS_AUTH=1 uv run devops ci

@dan-petty
dan-petty merged commit dd1b896 into release/v0.2.36 Oct 16, 2026
14 checks passed
@dan-petty
dan-petty deleted the feat/857-mcp-tool-annotations branch October 16, 2026 22:53
dan-petty added a commit that referenced this pull request Oct 17, 2026
* fix(github): fail closed on review thread read errors in pr readiness (#1583)

* chore(release): pin docker/setup-qemu-action SHA and align BaseCapability id types for ty 0.0.87 (#1582)

* fix(github): fail closed on review thread read errors in pr readiness

* fix(ai): emit failing unit test scaffolds in devops ai test-gen (#1584)

* fix(review): write no session directory or findings on dry-run review (#1587)

* feat(k8s): argo cd's web terminal opens a shell in any pod an application manages (#1586)

Set configs.cm."exec.enabled" to "true" in k8s/argocd/values.yaml. The pinned argo-cd chart
then grants argocd-server create on pods/exec, and Argo CD's built-in role:admin already holds
exec, create, so the admin user can open a pod's Terminal tab without kube API access from the
workstation.

Closes #1585

* test(cli): suppression comments may not grow unnoticed (#849) (#1590)

* fix(cli): messages reach the terminal as one line, so a command in one is never split by an inserted newline (#1589)

Step, raw and leveled messages go to Rich with soft_wrap=True. Rich's own word wrap wrote a
newline at a space, which split a command a message names, such as `devops devcontainer
unlock-keyring`, so copying it gave two lines. Tables, panels and Markdown keep Rich's layout.

An abandoned keyring prompt (timeout, EOF or Ctrl-C) now ends its line before the message that
follows: getpass writes that newline only once the prompt is answered.

Closes #1588

* fix(docs): generated reference docs fail closed and describe the real surface (#854) (#1591)

* test(cli): whole-tree import-cycle and interface-layer invariants (#848) (#1592)

* fix(roadmap): an intake placement that fails stops only its own candidate, and the round still reports the failure and exits non-zero (#1593)

apply_intake applies each candidate's writes on its own. A GitHubOperationError skips that
candidate with a warning naming it and the error, and the round's other candidates are still
written. raise_for_failed_placements then raises RoadmapIntakeError (ROADMAP_INTAKE_FAILED)
naming each skipped candidate and its error's class: `devops roadmap intake --confirm` reports
what it placed and exits 1, and the roadmap run's intake job fails. A GitHubRateLimitError,
which also carries a GraphQL budget refusal, still stops the round at once.

GitHub answers the board add of some existing issues with an INTERNAL error, which stopped
every round at the first of them.

Closes #1443

* feat(ai): one json repair seam that counts repairs per entry point (#875) (#1594)

* feat(ci): fail-to-pass check proves a fix's tests fail on its base (#844) (#1596)

* feat(k8s): the kube api is reachable off the home network at k8s.<domain> through the cloudflare tunnel, behind access, with kubectl over cloudflared access tcp (#1597)

- k8s/cloudflared/networkpolicy.yaml lets cloudflared reach the API server on 6443 through an ipBlock peer with the metadata address excluded, as Argo CD's rule does (#1371).
- `devops cloudflare tunnel sync` inserts a new hostname before the first wildcard rule that would match it (cloudflared's matchHost: a leading `*.` matches any name ending in the rest), so `k8s.<domain>` is reached under an existing `*.<domain>` route.
- cloudflared 2026.9.3 is a tools.lock binary. A build may name its own format, since cloudflared ships bare Linux binaries and macOS tar.gz archives.
- k8s/README.md documents the tcp:// route, `cloudflared access tcp` and the kubeconfig context.

Closes #1595

* feat(review): devops-cli's rule pack turns the recall set's network-exposure entries into tested Semgrep rules, and CI runs the pack's tests when a rule changes (#1145) (#1598)

* feat(mcp): declare ToolAnnotations readOnlyHint on all tools and default tf_apply auto_approve=False (#857) (#1600)

* fix(github): supply-chain claims made true — live Dependabot, zizmor and workflow invocation contracts (#1599)

* fix(github): supply-chain claims made true — live Dependabot, zizmor and workflow invocation contracts

- zizmor 1.30.1 is pinned in the dev group. `devops scan workflows` runs it offline with --no-exit-codes, shows every finding and fails on template-injection, unpinned-uses and excessive-permissions, or when zizmor could not run; `devops ci` runs it as the `zizmor` check.
- No `run:` block interpolates a `${{ }}` expression: the release workflow's version, notes, tag and milestone steps and ci.yml's image name take their values through `env:` or the runner's GITHUB_REPOSITORY.
- `devops ci maintain` audits with the `audit` check's `uv audit` instead of the undeclared pip-audit, and reports an audit that could not run (uv exit 2) apart from one that found vulnerabilities (exit 1).
- docs/SDLC.md drops the Dependabot, pip-audit and SLSA Level 3 claims and names the controls the repository runs; the Renovate line says Renovate acts only where its GitHub App is installed.
- Contract tests resolve every `devops` command in the workflows, composite actions and pre-commit hooks with resolve_devops_argv, and pin that no run block holds an expression and every remote `uses:` is SHA-pinned.

Closes #861

* fix(ci): fail-to-pass replay counts the other changed tests when one cannot be collected on base

`devops ci fail-to-pass` runs the changed test files on the merge-base tree in one pytest session. A fix that adds a module and a test file importing it cannot collect that file on base, and pytest then ran none of the files, so the gate found no failing test and failed the PR. The replay passes `--continue-on-collection-errors`: the file is reported as errored and the others run. This PR's own `tests/test_security_zizmor.py` hit it.

* feat(review): run review tools at project versions and gate on 5-tuple cached canaries (#1143) (#1603)

* feat(review): run review tools at project versions and gate on 5-tuple cached canaries (#1143)

* fix(review): isolate tool canaries with recorded outputs in conftest and keep scanner failure reasons

* fix(github): pr monitor judges each check by its latest run, so a cancelled run a newer one replaced does not fail the pr (#1605)

The REST check-runs listing returns every check suite's runs, so a workflow that cancels its in-progress run when a newer event starts it leaves the cancelled run beside its replacement; `filter=latest` collapses runs only within a suite. `_parse_rest_check_runs_payload` now drops a cancelled run when a later-started run of the same check exists. A cancelled run with no newer one still fails, and a failure is never dropped. PR #1599's checks read as 2 cancelled and failing before, and as passing after.

Closes #1602

* fix(telemetry): resetting the tracer waits for its exports, so no test's exports run on into the next (#1606)

`reset_tracer()`, which the autouse config fixture calls before and after every test, dropped the global tracer without shutting it down, so exports queued on its two-worker executor kept running into the next test. `tests/test_roadmap_dry_runs.py`'s dry-run test refuses connections process-wide and intermittently recorded those exports' connections to localhost:4318. The reset now calls `shutdown()` on the dropped tracer, which waits up to DEFAULT_OTEL_DRAIN_TIMEOUT_SECONDS for exports in flight and closes the executor.

The five-persona transient-503 review test also asserts the error its review recorded, so its own intermittent `failed` stage names its cause the next time it happens.

Closes #1604

* fix(tests): isolate KeyringBackend._classes registration across xdist workers (#1607)

keyring registers every concrete KeyringBackend subclass as a candidate for the rest of the process and picks the highest-priority viable one when it next detects a backend; a ChainerBackend also takes its members from get_viable_backends(). Test doubles in tests/test_config_cmd.py therefore became later tests' keyrings in the same xdist worker: `FakeChainer` (priority 10) made writes fail with "'EncryptedKeyring' object has no attribute 'set_password'" (test_k8s_bootstrap_openwebui), and `Raising` (priority 1, KeyringLocked) made reads warn that the keyring was locked (test_review_embeddings_unserved, test_roadmap_refine). An autouse fixture (tests/keyring_isolation.py) unregisters the backend classes each test defines and restores keyring's chosen backend.

Closes #1601

* feat(review): zizmor's workflow findings reach code scanning through devops scan report, and reviews run it (#1610)

`ZizmorScanner` (security/zizmor.py) registers zizmor with the default scanner registry, built on the same offline command and JSON parser `devops scan workflows` uses. It applies where the target has a `.github/workflows` directory, or, for a list of files, to its workflow and action files, and an isolated review scan hands it `--config` with no rules changed (#972). Its findings are non-gating, so `devops scan report` and its SARIF publish all of them while `devops scan workflows` stays the gate. Finding titles are `[<audit>] <description>`, so `extract_rule_id` gives SARIF the audit's name as its rule ID. On this repository the SARIF carries the 26 non-gated findings under the `zizmor` tool and the report exits 0.

Closes #1608

* feat(review): grounded per-group model analysis and plan verified with G10 checks (#1147) (#1611)

* fix(telemetry): aggregate delta metrics via OTel SDK MeterProvider and use prometheus-client (#792) (#1612)

* feat(k8s): qdrant metrics with an authenticated scrape, and its dashboard row restored (#823) (#1613)

* fix(ci): the v0.2.36 release pull request's checks pass: the service image takes Debian security updates, checkouts keep no credentials, and zizmor's self-repository audit waits for actionlint (#1616)

- Service Image: Trivy failed on CVE-2026-8286, CVE-2026-8927 and CVE-2026-92392 in libcurl3t64-gnutls 8.14.1-2+deb13u5. The Dockerfile already runs `apt-get upgrade`, but the build reused that layer from the GitHub Actions cache, made before Debian published deb13u7. The final stage is named `service` and the three service-image builds pass `no-cache-filters: service`; a fresh upgrade of the same base installs deb13u7.
- zizmor artipacked (release PR threads): every actions/checkout sets persist-credentials, false except release.yml's release job, which pushes its tag; tests/test_workflow_contracts.py checks that only a job running `git push` keeps them.
- zizmor self-repository (release PR threads): `.github/zizmor.yml` disables the audit, whose `$/<path>` form actionlint 1.7.12 rejects ("ref is missing").
- The five-persona transient-503 stall test (#1609) records any gateway request that bypasses its fake transport, by method and path, and asserts there are none, so its intermittent CI failure ("Cannot connect to AI provider API") names the request next time.

* chore(release): cut v0.2.36 — version 0.2.36, the changelog fragments collected and the roadmap rendered (#1614)

The changes `devops roadmap close --confirm` makes when it cuts v0.2.36, produced by its own `cut_release` (`is_prepare=True`, `sync_docs=False`, and the close job's docs/ROADMAP.md render as its edit) from release/v0.2.36 at 414a290, as a pull request instead of the cut's commit and push to the release branch: pyproject.toml and uv.lock at 0.2.36, the 24 changelog.d fragments collected into CHANGELOG.md's [0.2.36] - 2026-10-17 section and deleted, and docs/ROADMAP.md rendered from GitHub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant