Skip to content

Commit 333ccc8

Browse files
committed
feat(mcp,vscode): clarify repository health and triage focus semantics
- add compact MCP interpretation fields for health_scope, focus, and new_by_source_kind across summary, production triage, and changed-scope projections - make the VS Code extension explain repository-wide health, production focus, outside-focus debt, and new-finding source-kind attribution more clearly without widening the review flow - bump the preview VS Code extension to 0.2.2 and record the UX clarification pass in its changelog
1 parent 6953347 commit 333ccc8

26 files changed

+269
-48
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
report metadata, MCP summary/triage projections, and the HTML Executive Summary subtitle.
1010
- Clarify MCP interpretation with compact `health_scope`, `focus`, and `new_by_source_kind` fields in summary/triage
1111
projections.
12+
- Make baseline mismatch handling more explicit in MCP and the VS Code client by surfacing baseline/runtime python tags
13+
and whether comparison is proceeding without a valid baseline.
14+
- Make the Codex plugin prefer workspace-local launchers before `PATH`, with Poetry environment fallback for
15+
python-tag-safe MCP startup.
1216
- Refresh branch metadata and client docs for the `2.0.0b5` line.
1317
- Update the README repository health badge to `87 (B)`.
1418

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ repos:
163163
Optional read-only MCP server for AI agents and IDE clients.
164164
21 tools + 10 resources — never mutates source, baselines, or repo state.
165165
Compact summary and triage payloads make scope explicit: repository-wide health,
166-
current focus, and new-finding source-kind attribution.
166+
current focus, new-finding source-kind attribution, and when comparison is
167+
proceeding without a valid baseline.
167168
168169
```bash
169170
uv tool install --pre "codeclone[mcp]" # or: uv pip install --pre "codeclone[mcp]"

codeclone/mcp_service.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,7 @@ def get_production_triage(
16701670
"run_id": self._short_run_id(record.run_id),
16711671
"focus": _FOCUS_PRODUCTION,
16721672
"health_scope": _HEALTH_SCOPE_REPOSITORY,
1673+
"baseline": dict(self._as_mapping(summary.get("baseline"))),
16731674
"health": dict(self._summary_health_payload(summary)),
16741675
"cache": dict(self._as_mapping(summary.get("cache"))),
16751676
"findings": {
@@ -3283,6 +3284,7 @@ def _changed_analysis_payload(
32833284
"run_id": self._short_run_id(record.run_id),
32843285
"focus": _FOCUS_CHANGED_PATHS,
32853286
"health_scope": _HEALTH_SCOPE_REPOSITORY,
3287+
"baseline": dict(self._summary_baseline_payload(record.summary)),
32863288
"changed_files": len(record.changed_paths),
32873289
"health": health_payload,
32883290
"analysis_profile": self._summary_analysis_profile_payload(record.summary),
@@ -3959,6 +3961,7 @@ def _build_run_summary_payload(
39593961
"root": str(root_path),
39603962
"analysis_mode": request.analysis_mode,
39613963
"codeclone_version": meta.get("codeclone_version", __version__),
3964+
"python_tag": str(meta.get("python_tag", "")),
39623965
"report_schema_version": report_document.get(
39633966
"report_schema_version",
39643967
REPORT_SCHEMA_VERSION,
@@ -3971,6 +3974,7 @@ def _build_run_summary_payload(
39713974
"loaded": bool(meta_baseline.get("loaded", baseline_state.loaded)),
39723975
"status": str(meta_baseline.get("status", baseline_state.status.value)),
39733976
"trusted_for_diff": baseline_state.trusted_for_diff,
3977+
"python_tag": meta_baseline.get("python_tag"),
39743978
},
39753979
"metrics_baseline": {
39763980
"path": meta_metrics_baseline.get(
@@ -4096,11 +4100,21 @@ def _summary_trusted_state_payload(
40964100
key: str,
40974101
) -> dict[str, object]:
40984102
baseline = self._as_mapping(summary.get(key))
4099-
return {
4103+
trusted = bool(baseline.get("trusted_for_diff", False))
4104+
payload: dict[str, object] = {
41004105
"loaded": bool(baseline.get("loaded", False)),
41014106
"status": str(baseline.get("status", "")),
4102-
"trusted": bool(baseline.get("trusted_for_diff", False)),
4107+
"trusted": trusted,
41034108
}
4109+
if key == "baseline":
4110+
payload["compared_without_valid_baseline"] = not trusted
4111+
baseline_python_tag = baseline.get("python_tag")
4112+
runtime_python_tag = summary.get("python_tag")
4113+
if isinstance(baseline_python_tag, str) and baseline_python_tag.strip():
4114+
payload["baseline_python_tag"] = baseline_python_tag
4115+
if isinstance(runtime_python_tag, str) and runtime_python_tag.strip():
4116+
payload["runtime_python_tag"] = runtime_python_tag
4117+
return payload
41044118

41054119
def _summary_cache_payload(
41064120
self,

docs/book/20-mcp-interface.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ Current server characteristics:
5959
- `health_scope` explains what the health score covers
6060
- `focus` explains the active summary/triage lens
6161
- `baseline`, `metrics_baseline`, `cache`
62+
- untrusted baseline comparisons stay compact but explicit through
63+
`baseline.compared_without_valid_baseline`,
64+
`baseline.baseline_python_tag`, and `baseline.runtime_python_tag`
6265
- `cache.freshness` classifies summary cache reuse as `fresh`, `mixed`,
6366
or `reused`
6467
- flattened `inventory` (`files`, `lines`, `functions`, `classes`)
@@ -67,9 +70,10 @@ Current server characteristics:
6770
- flattened `diff` (`new_clones`, `health_delta`)
6871
- `warnings`, `failures`
6972
- `analyze_changed_paths` is intentionally more compact than `get_run_summary`:
70-
it returns `changed_files`, `focus`, `health_scope`, `health`,
71-
`health_delta`, `verdict`, `new_findings`, `new_by_source_kind`,
72-
`resolved_findings`, and an empty `changed_findings` placeholder, while
73+
it returns `changed_files`, compact `baseline`, `focus`, `health_scope`,
74+
`health`, `health_delta`, `verdict`, `new_findings`,
75+
`new_by_source_kind`, `resolved_findings`, and an empty
76+
`changed_findings` placeholder, while
7377
detailed changed payload stays in
7478
`get_report_section(section="changed")`
7579
- workflow guidance:

docs/book/21-vscode-extension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ The extension runs as a workspace extension and requires:
123123
- CodeClone `2.0.0b4` or newer
124124

125125
In `auto` mode, launcher resolution prefers the current workspace virtualenv
126-
before `PATH`.
126+
before `PATH`. Runtime and version-mismatch messages identify that resolved launcher source.
127127

128128
For this reason:
129129

docs/book/23-codex-plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The plugin currently provides:
4646
The plugin surface is additive:
4747

4848
- `.mcp.json` contributes a local stdio MCP server definition
49+
- that launcher prefers a workspace `.venv`, then a Poetry env, then `PATH`
4950
- the skill contributes workflow guidance and starter prompts
5051
- `README.md` documents local usage and boundaries inside the repository tree
5152
- Codex remains free to use direct `mcp add` config alongside or instead of the
@@ -65,7 +66,8 @@ The plugin does not rewrite user config or install CodeClone automatically.
6566
- **Repo-local clarity**: the plugin is meant to travel with the repository as
6667
a native Codex surface.
6768
- **Launcher honesty**: the plugin assumes `codeclone-mcp` is already
68-
installable or configured in the local environment.
69+
installable in the current workspace or reachable on `PATH`, and prefers the
70+
workspace environment when one is present.
6971

7072
## Relationship to other interfaces
7173

docs/codex-plugin.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,24 @@ Repo-local discovery via `.agents/plugins/marketplace.json`.
88
| File | Purpose |
99
|------------------------------|----------------------------------------------------|
1010
| `.codex-plugin/plugin.json` | Plugin metadata, prompts, instructions |
11-
| `.mcp.json` | Local `codeclone-mcp --transport stdio` definition |
11+
| `.mcp.json` | Workspace-first MCP launcher definition |
1212
| `skills/codeclone-review/` | Conservative-first full review skill |
1313
| `skills/codeclone-hotspots/` | Quick hotspot discovery skill |
1414
| `assets/` | Plugin branding |
1515

1616
## Install
1717

1818
```bash
19-
uv tool install --pre "codeclone[mcp]" # or: uv pip install --pre "codeclone[mcp]"
20-
codeclone-mcp --help # verify
19+
uv venv
20+
uv pip install --python .venv/bin/python "codeclone[mcp]>=2.0.0b4"
21+
.venv/bin/codeclone-mcp --help
22+
```
23+
24+
Global fallback:
25+
26+
```bash
27+
uv tool install "codeclone[mcp]>=2.0.0b4"
28+
codeclone-mcp --help
2129
```
2230

2331
Manual MCP registration without the plugin:
@@ -36,7 +44,7 @@ gets a local MCP definition and two skills. Does not mutate
3644

3745
- if you already registered `codeclone-mcp` manually, keep only one setup path
3846
to avoid duplicate MCP surfaces
39-
- the bundled `.mcp.json` assumes `codeclone-mcp` resolves on `PATH`
47+
- the bundled `.mcp.json` prefers `.venv`, then a Poetry env, then `PATH`
4048

4149
For the underlying interface contract, see:
4250

docs/mcp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ run-scoped URI templates.
121121
- Summary and triage projections keep interpretation compact: `health_scope`
122122
explains what the health score covers, `focus` explains the active view, and
123123
`new_by_source_kind` attributes new findings without widening the payload.
124+
- When baseline comparison is untrusted, summary and triage also expose
125+
`baseline.compared_without_valid_baseline` plus baseline/runtime python tags.
124126
- Run IDs are 8-char hex handles; finding IDs are short prefixed forms.
125127
Both accept the full canonical form as input.
126128
- `metrics_detail(family="overloaded_modules")` exposes the report-only

docs/vscode-extension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The extension needs a local `codeclone-mcp` launcher.
3030
Minimum supported CodeClone version: `2.0.0b4`.
3131

3232
In `auto` mode, it checks the current workspace virtualenv before falling back
33-
to `PATH`.
33+
to `PATH`. Runtime and version-mismatch messages identify that resolved launcher source.
3434

3535
Recommended install for the preview extension:
3636

extensions/claude-desktop-codeclone/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": "0.3",
33
"name": "codeclone",
44
"display_name": "CodeClone",
5-
"version": "2.0.0-b4.0",
5+
"version": "2.0.0-b5.0",
66
"description": "Baseline-aware structural review for Claude Desktop through a local CodeClone MCP launcher.",
77
"long_description": "CodeClone for Claude Desktop wraps the local codeclone-mcp launcher as an MCP bundle. It keeps Claude on the same canonical MCP surface used by the CLI, HTML report, VS Code extension, and Codex plugin — read-only, baseline-aware, local stdio only.",
88
"author": {

0 commit comments

Comments
 (0)