Skip to content

Commit d4d6270

Browse files
committed
feat(planning): scaffold phases 9/10/11 backlog + forward-facing .planning/
Per CR §9 Workstream D (decision locked 2026-05-14): formalize the post-v0.1.5 backlog with three new MCP-tool phases. Each gets an on-disk CONTEXT.md skeleton plus a row in .planning/ROADMAP.md. Implementation kickoff still requires /gsd-plan-phase 0X per phase; this commit only publishes the specs. Phase 09 — compare_versions(symbol, v1, v2): structured per-version diff of a stdlib symbol (signature + docstring + deprecation). Phase 10 — whatsnew_for_version(version): the official 'What's New' page sliced into MCP-friendly sections with kind enums and pagination. Phase 11 — detect_python_version v2 (venv-aware): elevate the v1 detection chain to read VIRTUAL_ENV / pyvenv.cfg / .venv directories before falling back to .python-version / python3 / sys.version_info. Backfills tests/test_detection.py (v1 has no dedicated unit test today). Also updates AGENTS.md 'Context Hygiene' to acknowledge .planning/ now holds two kinds of content: live forward-looking specs (ROADMAP, phase CONTEXTs) and archival history (pre-2026-05 content). The prior 'archival-only' framing predated the v0.1.5 launch coordination work. GitHub issues for these three phases will be opened separately after this PR merges (D5; not included here to avoid stale issue numbers).
1 parent 147a9ac commit d4d6270

5 files changed

Lines changed: 155 additions & 12 deletions

File tree

.planning/ROADMAP.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Roadmap
2+
3+
## Current
4+
5+
- **v0.1.4** — shipped (pre-PyPI; installed via `uvx --from git+…`)
6+
- **v0.1.5** — in progress (PyPI debut, repo rename to `python-stdlib-mcp`, positioning lockdown, benchmark harness, launch post). See [`CHANGE-REQUEST-v0.1.5-launch.md`](../CHANGE-REQUEST-v0.1.5-launch.md) for the full scope.
7+
8+
## Backlog (post-v0.1.5)
9+
10+
| Phase | Title | Tool surface | Issue |
11+
|-------|-------|--------------|-------|
12+
| 09 | `compare_versions(symbol, v1, v2)` | New MCP tool | #TBD-link-after-PR-merges |
13+
| 10 | `whatsnew_for_version(version)` | New MCP tool | #TBD-link-after-PR-merges |
14+
| 11 | `detect_python_version` v2 (venv-aware) | Existing tool enhancement | #TBD-link-after-PR-merges |
15+
16+
These are planned, not committed. Phase CONTEXTs at [`phases/09-compare-versions/`](phases/09-compare-versions/09-CONTEXT.md), [`phases/10-whatsnew/`](phases/10-whatsnew/10-CONTEXT.md), [`phases/11-detect-venv/`](phases/11-detect-venv/11-CONTEXT.md). Implementation kickoff requires `/gsd-plan-phase 0X`.
17+
18+
## Historical
19+
20+
Pre-2026-05-14 GSD workflow artifacts (phases 1–8 for v0.1.0) live in maintainers' local worktrees and are intentionally not tracked in this repo. See the note in `.git/info/exclude` for the prior policy. With v0.1.5 the `.planning/` directory becomes a tracked, forward-facing surface for new phase CONTEXTs and roadmap entries.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Phase 09 — compare_versions(symbol, v1, v2)
2+
3+
**Status:** Backlog (post-v0.1.5)
4+
**Type:** New MCP tool
5+
6+
## Goal
7+
8+
Add an MCP tool `compare_versions(symbol, v1, v2)` that returns a structured diff of a stdlib symbol's signature, behavior, and docstring between two Python versions.
9+
10+
## Depends on
11+
12+
- v0.1.5 ships (PyPI debut + repo rename complete).
13+
- Index supports the two versions being compared (handled by `build-index`).
14+
15+
## Requirements
16+
17+
- CMPR-01: Tool accepts `(symbol: str, v1: str, v2: str)`. Returns a structured diff: signature change, docstring delta, deprecation flag, see-also additions/removals.
18+
- CMPR-02: Both versions must already be indexed; if not, tool returns an actionable error pointing at `build-index`.
19+
- CMPR-03: Diff format is JSON-serializable and token-frugal — no full re-printing of unchanged paragraphs.
20+
21+
## Success criteria
22+
23+
1. `compare_versions("asyncio.TaskGroup", "3.11", "3.12")` returns a clear, machine-readable diff highlighting the introduction in 3.11.
24+
2. Comparing identical versions returns an empty diff with an explicit "no change" marker.
25+
3. Missing-version cases return an actionable error with the indexed-version list.
26+
4. Token cost of a typical diff is under 300 tokens (vs ~1500 for fetching both full doc pages).
27+
5. Integration test in `tests/test_compare_versions.py` exercises 3 representative symbols (one changed, one unchanged, one missing).
28+
29+
## Plans
30+
31+
TBD — run `/gsd-plan-phase 09` after this issue is prioritized.
32+
33+
## UI hint
34+
35+
No UI surface; pure MCP tool.
36+
37+
## Out of scope
38+
39+
- Cross-language diffs (Python stdlib only).
40+
- Non-symbol diffs (module-level changes belong in phase 10).
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Phase 10 — whatsnew_for_version(version)
2+
3+
**Status:** Backlog (post-v0.1.5)
4+
**Type:** New MCP tool
5+
6+
## Goal
7+
8+
Return the official "What's New in Python `<version>`" content as structured sections, scoped by topic — new modules, deprecations, removals, performance, syntax. The current alternative is for the agent to fetch a full HTML page; this tool returns just the requested sections.
9+
10+
## Depends on
11+
12+
- v0.1.5 ships.
13+
- Ingestion already covers `whatsnew/<version>.html` (verify during phase planning).
14+
15+
## Requirements
16+
17+
- WNEW-01: Tool accepts a Python version string. Returns `{ "sections": [{title, anchor, body, kind}] }`.
18+
- WNEW-02: `kind` enum: `new_module | new_feature | deprecation | removal | performance | syntax | other`.
19+
- WNEW-03: Token cost capped at ~2k per section; pagination supported via section index.
20+
21+
## Success criteria
22+
23+
1. `whatsnew_for_version("3.12")` returns ≥10 sections, each with a non-empty body.
24+
2. Each section has a stable anchor matching docs.python.org.
25+
3. Filtering by `kind` is supported (`whatsnew_for_version("3.12", kind="deprecation")`).
26+
4. Missing version returns the same actionable error pattern as `compare_versions`.
27+
5. Integration test in `tests/test_whatsnew.py` covers two representative versions.
28+
29+
## Plans
30+
31+
TBD.
32+
33+
## UI hint
34+
35+
No UI surface; pure MCP tool.
36+
37+
## Out of scope
38+
39+
- Third-party "what's new" guides.
40+
- Cross-version aggregation (use `compare_versions` instead).
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Phase 11 — detect_python_version v2 (venv-aware)
2+
3+
**Status:** Backlog (post-v0.1.5)
4+
**Type:** Enhancement of existing MCP tool
5+
6+
## Goal
7+
8+
Make `detect_python_version` venv-aware: report the Python version of the *active virtual environment* in the user's project, not just the value from `.python-version` or `python3 --version` on PATH.
9+
10+
## Depends on
11+
12+
- v0.1.5 ships.
13+
- v1 implementation at `src/mcp_server_python_docs/detection.py` (current 3-step detection order: `.python-version``python3 --version``sys.version_info`).
14+
- v1 has NO dedicated unit test file — backfill `tests/test_detection.py` as part of this phase.
15+
16+
## Requirements
17+
18+
- DETV2-01: Detect active venv via the `VIRTUAL_ENV` env var; if present, read `$VIRTUAL_ENV/pyvenv.cfg` for `version_info`.
19+
- DETV2-02: Detect `.venv/` or `venv/` directories in cwd or its ancestors (up to project root).
20+
- DETV2-03: Detect `uv`'s `.venv` and `poetry`'s `.venv` patterns.
21+
- DETV2-04: Preserve v1 fallback chain unchanged below the new venv checks.
22+
- DETV2-05: Return `(major_minor, source)` tuple where `source` discriminates `venv:VIRTUAL_ENV` / `venv:.venv` / `python-version` / `python3` / `sys.version_info`.
23+
24+
## Success criteria
25+
26+
1. Inside an activated venv (3.12) on a 3.13 host: returns `("3.12", "venv:VIRTUAL_ENV")`.
27+
2. With no venv but `.python-version` present: returns `("X.Y", "python-version")` — v1 behavior preserved.
28+
3. With nothing: returns `(sys-version, "sys.version_info")` — v1 fallback preserved.
29+
4. Backfill: `tests/test_detection.py` covers all five `source` cases.
30+
5. No regression in v1 callers (`server.py` MCP tool wrapper signature unchanged).
31+
32+
## Plans
33+
34+
TBD.
35+
36+
## UI hint
37+
38+
No UI surface; pure MCP tool.
39+
40+
## Out of scope
41+
42+
- conda / mamba environments (separate phase if demand surfaces).
43+
- Cross-platform venv path quirks beyond Unix + Windows (both must be tested).

AGENTS.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ Before calling work complete:
8383

8484
## Context Hygiene
8585

86-
Treat `.planning/` as archival project history, not live repo truth.
87-
88-
Start with these files instead:
89-
90-
- `README.md`
91-
- `CONTRIBUTING.md`
92-
- `.github/INTEGRATION-TEST.md`
93-
- `tests/`
94-
95-
The generated planning files may still be useful for maintainers who want the
96-
old GSD workflow context, but they should not drive routine implementation
97-
decisions.
86+
`.planning/` mixes archival history with forward-facing phase CONTEXTs.
87+
88+
- `.planning/ROADMAP.md` and `.planning/phases/0X-…/0X-CONTEXT.md` are live,
89+
forward-looking specs — read these first when starting a new phase.
90+
- Anything else in `.planning/` (especially content dated 2026-04 or earlier)
91+
is archival history. It may help maintainers reconstruct prior context but
92+
should not drive routine implementation decisions.
93+
- For the source of truth about *what the code does today*, start with:
94+
- `README.md`
95+
- `CONTRIBUTING.md`
96+
- `.github/INTEGRATION-TEST.md`
97+
- `tests/`

0 commit comments

Comments
 (0)