Skip to content

feat: helm_list_releases — release status reachable over MCP/agent - #163

Merged
hellices merged 1 commit into
mainfrom
feat/helm-list-tool
Aug 2, 2026
Merged

feat: helm_list_releases — release status reachable over MCP/agent#163
hellices merged 1 commit into
mainfrom
feat/helm-list-tool

Conversation

@hellices

@hellices hellices commented Aug 2, 2026

Copy link
Copy Markdown
Owner

Closes #161 (split from #158)

What

helm_list_releases — a cluster_read tool on every surface (full/small agent + MCP), so release status is finally reachable without the user driving the TUI:

prod/web  -  age=3d  revision=3 status=deployed chart=web-1.2.3 app_version=2.7.1

How

  • KubeClient.list_helm_releases(namespace|None): LIST-only, latest revision per release, from the helm-owned release Secrets (type=helm.sh/release.v1 + owner=helm selectors) — the exact parsing path the TUI's synthetic helmreleases kind uses. No helm binary, no [agent] extra.
  • ReadOps gains the abstractmethod; the eval harness's FakeKubeClient implements it by parsing scenario Secrets (same latest-revision reduction).
  • Executor: line shape reuses the facts renderers list_resources drops every status column the TUI shows (name+age only) — forces N+1 get_resource calls from MCP/agent #158 registered ahead of time (HelmReleaseSummaryrevision= status= chart= app_version=), so TUI/tool parity is free — all values already clamped/flattened by _clamp.
  • Follow mode (MCP follow mode: mirror external read tool calls in the TUI (most MCP calls today are invisible on screen) #153): mirrors as agent_navigate("helm"); the FOLLOWABLE/UNMIRRORED pairing test forced the decision at compile time as designed. The navigation-mirror branch was extracted to a small table (_NAVIGATE_MIRRORS) for C901.
  • Small profile: concise description within the 250-char budget (test_small_profile_trims_verbose_descriptions caught the verbose one).
  • docs/mcp.md: surface summary + follow-mode table row.

Testing

  • tests/k8s/test_helm.py::TestListHelmReleases: latest-revision reduction across mixed revisions/statuses; cluster-wide path + helm-owner selectors when namespace omitted.
  • tests/tools/test_list_resources.py: end-to-end tool output (facts line), (none), and error passthrough.
  • tests/tools/test_follow.py: mirror mapping + the pairing test now covers the new tool.
  • Golden surface-order tests updated (read tools gain one entry before diagnose_pod).

Full gate green: ruff, mypy --strict, tach, 2976 passed / 21 skipped, coverage ≥ 80%.

…P/agent (#161)

Helm releases had no read tool at all: an MCP host or the built-in
agent could not see release status/chart/revision without the user
driving the TUI.

- KubeClient.list_helm_releases: LIST-only latest-revision-per-release
  from the helm-owned Secrets (same parsing as the browser's synthetic
  kind - no helm binary, no [agent] extra); ReadOps gains the
  abstractmethod, the eval FakeKubeClient parses scenario Secrets.
- registry: helm_list_releases cluster_read on all surfaces, with a
  concise small-profile description (250-char budget).
- executor: one line per release reusing the #158 facts renderers -
  revision/status/chart/app_version parity with the TUI table for free.
- follow mode: mirrors as agent_navigate('helm'); the pairing test
  forced the FOLLOWABLE decision. Navigation-mirror mapping extracted
  to a table (C901).
- docs/mcp.md: surface summary + follow-mode table.

Closes #161

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 2, 2026 19:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Helm release status as a read-only tool across agent and MCP surfaces.

Changes:

  • Lists latest Helm release revisions from cluster Secrets.
  • Adds formatted executor output and follow-mode navigation.
  • Updates interfaces, eval fakes, tests, profiles, and MCP docs.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/korvid/k8s/client.py Implements Helm release listing.
src/korvid/k8s/reads.py Extends the read interface.
src/korvid/k8s/evals/fake_kube.py Adds scenario-backed listing.
src/korvid/tools/registry.py Registers the new tool.
src/korvid/tools/executor.py Formats release results.
src/korvid/tools/follow.py Mirrors calls to the Helm view.
src/korvid/agent/profiles.py Adds the small-profile description.
tests/k8s/test_helm.py Tests selection and query scope.
tests/tools/test_list_resources.py Tests tool output and errors.
tests/tools/test_follow.py Tests follow-mode behavior.
tests/tools/test_registry.py Updates surface-order expectations.
tests/tools/test_executor.py Updates read-tool expectations.
docs/mcp.md Documents availability and follow mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@my-reviewer-agent my-reviewer-agent Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — issue #161 helm_list_releases 신규 리뷰.

확인한 내용:

  • KubeClient.list_helm_releases가 TUI helm 브라우저와 동일한 Secret 파싱 경로(release_from_secret + type/owner 셀렉터 _helm_secrets_query)를 재사용 — LIST-only, helm 바이너리 불필요. 최신 revision 축약 로직이 client/FakeKubeClient 양쪽에서 동일함을 head에서 검증.
  • 출력 라인의 r.namespace/r.name_clamp 미적용이지만 둘 다 K8s label-value/DNS-1123 제약(개행·제어문자 불가) 값이라 #156/#162 계열 위조 주입 표면이 없고, 나머지 facts(revision/status/chart/app_version)는 summary_facts_clamp 경로로 이미 flatten+bound 처리됨 (_list_resources와 동일한 관례).
  • follow 모드: _NAVIGATE_MIRRORS 테이블 추출로 list_operators 분기와 통합, FOLLOWABLE 페어링 테스트가 신규 툴을 강제 — 미러 결정이 컴파일 타임에 잡히는 설계 유지.
  • 테스트 실질성: cluster-wide 경로에서 labelSelector=owner%3Dhelm 실제 쿼리 문자열 단언, 혼합 revision 축약, (none)/ERROR passthrough, 미러 뷰 매핑 모두 실제 동작 검증.
  • registry 골든 순서 테스트/small-profile 250자 예산 준수 확인.

지적사항 없음. 좋은 작업입니다.

@hellices
hellices merged commit a3b8a71 into main Aug 2, 2026
10 checks passed
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.

helm_list_releases read tool: release STATUS/CHART/REVISION invisible to MCP/agent

2 participants