|
| 1 | +# Stability Policy |
| 2 | + |
| 3 | +> **Status: Anticipated — not yet active.** |
| 4 | +> This policy describes the stability guarantees codegraph *will* provide once the public API surface stabilizes after [Phase 3 — Architectural Refactoring](ROADMAP.md). Until then, breaking changes may still land in minor releases as the internal architecture is restructured. |
| 5 | +
|
| 6 | +--- |
| 7 | + |
| 8 | +## Signal Status |
| 9 | + |
| 10 | +| Signal | Current Status | Planned | |
| 11 | +|--------|---------------|---------| |
| 12 | +| Stability policy | This document (anticipated) | Active after Phase 3 | |
| 13 | +| Deprecation warnings | Not yet | Phase 3+ | |
| 14 | +| Migration guides | Partial (v1→v2: "rebuild required") | Every major going forward | |
| 15 | +| Semantic versioning policy | SemVer followed, no support window | Phase 3+ | |
| 16 | +| LTS / release tracks | No | When adoption warrants | |
| 17 | +| API reference docs | CLI `--help` only | Phase 3+ | |
| 18 | +| `@deprecated` annotations | No | Phase 3+ | |
| 19 | +| MCP tool schema versioning | No | Phase 3+ | |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 1. Semantic Versioning |
| 24 | + |
| 25 | +Codegraph follows [SemVer 2.0.0](https://semver.org/). Once this policy is active, version bumps will be governed by these rules: |
| 26 | + |
| 27 | +### What counts as breaking (requires major bump) |
| 28 | + |
| 29 | +- Removing or renaming CLI commands or flags |
| 30 | +- Changing MCP tool names, required parameters, or response shapes |
| 31 | +- Removing or renaming programmatic exports from `index.js` |
| 32 | +- DB schema changes that require a full rebuild (without automatic migration) |
| 33 | + |
| 34 | +### What is NOT breaking |
| 35 | + |
| 36 | +- Internal function signatures (anything not exported from `index.js`) |
| 37 | +- Output formatting tweaks (column widths, colors, human-readable text) |
| 38 | +- Performance improvements |
| 39 | +- New additive features (new commands, new optional flags, new MCP tools) |
| 40 | +- Bug fixes that correct previously incorrect behavior |
| 41 | + |
| 42 | +### Support window |
| 43 | + |
| 44 | +**TBD.** The plan is to support at least one previous major version with critical bug and security fixes after a new major is released. The exact window will be defined when this policy activates. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## 2. Deprecation Policy |
| 49 | + |
| 50 | +Before removing any public API surface, codegraph will provide advance notice: |
| 51 | + |
| 52 | +1. **`@deprecated` JSDoc annotation** on the function or method, with a message pointing to the replacement. |
| 53 | +2. **Runtime `console.warn`** on first use per process, e.g.: |
| 54 | + ``` |
| 55 | + [codegraph] DEPRECATED: queryNameData() will be removed in v4.0. Use querySymbol() instead. |
| 56 | + ``` |
| 57 | +3. **Minimum deprecation window:** one minor release cycle before removal. The deprecation notice ships in version N.x, the removal lands no earlier than version (N+1).0. |
| 58 | + |
| 59 | +### Scope |
| 60 | + |
| 61 | +Deprecation notices apply to: |
| 62 | + |
| 63 | +- Exported functions and classes in `index.js` |
| 64 | +- CLI commands and flags |
| 65 | +- MCP tool schemas (tool names, parameter names, response properties) |
| 66 | + |
| 67 | +Internal functions not exported from `index.js` may be changed or removed without deprecation notices. |
| 68 | + |
| 69 | +--- |
| 70 | + |
| 71 | +## 3. Migration Guides |
| 72 | + |
| 73 | +Starting with the next major version, every major release will ship with a migration guide covering: |
| 74 | + |
| 75 | +- What changed and why |
| 76 | +- Step-by-step upgrade instructions |
| 77 | +- Before/after code examples for breaking API changes |
| 78 | +- DB migration steps (if any) |
| 79 | + |
| 80 | +Migration guides will be published in `docs/` alongside the release. |
| 81 | + |
| 82 | +### Retroactive acknowledgment |
| 83 | + |
| 84 | +**v1 → v2** required a full `codegraph build` to regenerate the graph database. No migration guide was published at the time. Going forward, this gap will not recur. |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## 4. Release Tracks |
| 89 | + |
| 90 | +### Current (active now) |
| 91 | + |
| 92 | +The **Current** track receives all new features and improvements. Breaking changes land in major versions. This is the only active track today. |
| 93 | + |
| 94 | +### LTS (planned, not yet active) |
| 95 | + |
| 96 | +An **LTS** (Long-Term Support) track is anticipated when adoption warrants it. When activated: |
| 97 | + |
| 98 | +- LTS releases receive security fixes and critical bug fixes only |
| 99 | +- LTS support window: N months after the next major version ships (exact duration TBD) |
| 100 | +- LTS releases will not receive new features |
| 101 | + |
| 102 | +LTS will be activated based on community adoption and demand — there is no fixed date. |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## 5. API Reference |
| 107 | + |
| 108 | +| Surface | Current State | Planned | |
| 109 | +|---------|--------------|---------| |
| 110 | +| CLI commands | Documented via `--help` and [README](README.md#-commands) | No change needed | |
| 111 | +| Programmatic API (`index.js`) | Documented in README examples | Auto-generated JSDoc reference (Phase 3+) | |
| 112 | +| MCP tools | Documented in [AI Agent Guide](docs/ai-agent-guide.md) | Versioned schema reference (Phase 3+) | |
| 113 | + |
| 114 | +The planned auto-generated reference will cover all public exports from `index.js` with full type signatures, parameter descriptions, and usage examples. |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## 6. MCP Tool Schema Versioning |
| 119 | + |
| 120 | +MCP tool schemas — tool names, parameter shapes (names, types, required/optional), and response shapes — are part of the public API. Once this policy is active: |
| 121 | + |
| 122 | +- **Breaking schema changes** (renaming a tool, removing a parameter, changing a response shape) require a **major version bump**. |
| 123 | +- **Additive changes** (new optional parameters, new tools, new response fields) are **non-breaking** and may land in minor versions. |
| 124 | + |
| 125 | +This ensures that AI agents relying on codegraph's MCP tools will not break silently on upgrade. |
0 commit comments