You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All notable changes to this project are documented in this file.
4
+
5
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
+
7
+
## [Unreleased]
8
+
9
+
### Added
10
+
11
+
-`__version__` in `app.py` for release tracking (`0.1.0.dev0` until the first `v0.1.0` git tag)
12
+
- Startup guard refusing `--debug` with a non-loopback `--host` (including bracketed IPv6 loopback such as `[::1]`)
13
+
-[Deprecation policy](docs/deprecation-policy.md) for API and JSON field changes
14
+
- API field **stability** tables in `docs/api-reference.md` (stable / experimental / deprecated)
15
+
16
+
### Changed
17
+
18
+
- README notes that the server enforces the debug + host safety rule at startup
19
+
20
+
### Deprecated
21
+
22
+
-`export_count` on `GET /api/export/state` (documented only; still returned). Use `last_export_session_count`. Removal planned in a follow-up release per [deprecation policy](docs/deprecation-policy.md).
-`--host 0.0.0.0` — listen on all interfaces (use only on trusted networks)
43
+
-`--host 0.0.0.0` — listen on all interfaces (use only on trusted networks; never with `--debug`)
44
+
-`--debug` — Flask/Werkzeug debug mode (loopback hosts only; enforced when starting via `python app.py`, not `flask run` or WSGI). Extending the guard to `FLASK_DEBUG` / `flask run` is a planned follow-up.
45
+
46
+
## API and release policy
47
+
48
+
-[CHANGELOG.md](CHANGELOG.md) — user-visible changes per release
49
+
-[docs/deprecation-policy.md](docs/deprecation-policy.md) — how deprecated API fields are removed
50
+
-[docs/api-reference.md](docs/api-reference.md) — field **stability** (`stable` / `experimental` / `deprecated`)
51
+
52
+
When changing JSON response shapes, update the API reference stability column and CHANGELOG before removing fields.
44
53
45
54
## Running tests
46
55
@@ -116,6 +125,8 @@ npm run test:coverage # optional
Copy file name to clipboardExpand all lines: docs/api-reference.md
+71-55Lines changed: 71 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,22 @@ HTTP API for **claude-code-chat-browser**. All `/api/*` routes return JSON unles
6
6
7
7
**Source of truth for error codes:**[`api/error_codes.py`](../api/error_codes.py)
8
8
9
+
**Deprecation and removal:** See [`deprecation-policy.md`](deprecation-policy.md) for how stability labels are applied and fields are removed. Field labels are defined in [API field stability](#api-field-stability) below.
10
+
11
+
---
12
+
13
+
## API field stability
14
+
15
+
Each response field below is labeled:
16
+
17
+
| Label | Meaning |
18
+
|-------|---------|
19
+
|**stable**| Will not be renamed or removed without a documented deprecation period |
20
+
|**experimental**| May change in any release; do not build long-lived integrations on these fields |
21
+
|**deprecated**| Still returned; use the documented replacement; removal announced in [CHANGELOG](../CHANGELOG.md)|
22
+
23
+
**Migration:** Breaking changes use additive deprecation first (new field → deprecate old → remove after policy period). Versioned routes (e.g. `/api/v2/...`) are reserved for future breaking reshapes; none exist today.
24
+
9
25
---
10
26
11
27
## Authentication
@@ -100,13 +116,13 @@ None.
100
116
101
117
`application/json` — array of project objects:
102
118
103
-
| Field | Type | Description |
104
-
|-------|------|-------------|
105
-
|`name`| string | Directory name under `~/.claude/projects/` (e.g. `F--boost-capy`) |
106
-
|`path`| string | Absolute path to project directory |
107
-
|`display_name`| string | Friendly name derived from session `cwd` when available |
108
-
|`session_count`| integer | Count of titled sessions (updated in handler) |
109
-
|`last_modified`| string (ISO 8601) | Latest message timestamp across titled sessions |
119
+
| Field | Type |Stability |Description |
120
+
|-------|------|-----------|-------------|
121
+
|`name`| string |stable |Directory name under `~/.claude/projects/` (e.g. `F--boost-capy`) |
122
+
|`path`| string |stable |Absolute path to project directory |
123
+
|`display_name`| string |stable |Friendly name derived from session `cwd` when available |
124
+
|`session_count`| integer |stable |Count of titled sessions (updated in handler) |
125
+
|`last_modified`| string (ISO 8601) |stable |Latest message timestamp across titled sessions |
110
126
111
127
```json
112
128
[
@@ -148,19 +164,19 @@ Lists sessions in one project with summary fields for the workspace sidebar. Ski
148
164
149
165
`application/json` — array of session row objects:
150
166
151
-
| Field | Type | Description |
152
-
|-------|------|-------------|
153
-
|`id`| string | Session id (filename without `.jsonl`) |
154
-
|`path`| string | Absolute path to JSONL file |
155
-
|`size_bytes`| integer | File size |
156
-
|`modified`| number | File mtime (epoch seconds) |
157
-
|`title`| string | Parsed session title |
158
-
|`models`| string[]| Models used in session |
159
-
|`tokens`| integer | Sum of input + output tokens |
160
-
|`tool_calls`| integer | Total tool calls |
161
-
|`first_timestamp`| string \| null | First message timestamp |
162
-
|`last_timestamp`| string \| null | Last message timestamp |
See [`utils/jsonl_parser.py`](../utils/jsonl_parser.py)`parse_session()` for the full metadata shape.
217
+
Nested keys inside `messages[]` and `metadata` follow the parser output; new parser fields may appear as **experimental** until listed here. See [`utils/jsonl_parser.py`](../utils/jsonl_parser.py)`parse_session()` for the full metadata shape.
202
218
203
219
#### Errors
204
220
@@ -228,21 +244,21 @@ Same as session detail.
228
244
229
245
`application/json` — stats object from [`utils/session_stats.py`](../utils/session_stats.py)`compute_stats()`:
|`snippet`| string |experimental |~160 chars around match; length may change|
287
303
288
304
#### Errors
289
305
@@ -306,11 +322,11 @@ Read-only snapshot of bulk-export state persisted under `~/.claude-code-chat-bro
306
322
307
323
#### Response — `200 OK`
308
324
309
-
| Field | Type | Description |
310
-
|-------|------|-------------|
311
-
|`last_export_time`| string \| null | ISO timestamp of last completed bulk export |
312
-
|`last_export_session_count`| integer | Sessions in last bulk export run |
313
-
|`export_count`| integer |**Legacy alias** — same value as `last_export_session_count`; prefer `last_export_session_count` in new integrations (kept for SPA backwards compatibility) |
325
+
| Field | Type |Stability |Description |
326
+
|-------|------|-----------|-------------|
327
+
|`last_export_time`| string \| null |stable |ISO timestamp of last completed bulk export |
328
+
|`last_export_session_count`| integer |stable |Sessions in last bulk export run |
329
+
|`export_count`| integer |deprecated |Legacy alias of `last_export_session_count`; prefer `last_export_session_count` in new code (still returned for SPA compatibility; removal per [deprecation-policy.md](deprecation-policy.md)) |
This document defines how **claude-code-chat-browser** evolves its HTTP JSON API and CLI without breaking integrators and the bundled SPA unexpectedly.
4
+
5
+
## Principles
6
+
7
+
1.**Documented fields are a contract.** See [API reference](api-reference.md) — each field is marked `stable`, `experimental`, or `deprecated`.
8
+
2.**Additive first.** Prefer adding a new field over renaming an existing one.
9
+
3.**Deprecate before removing.** A deprecated field remains in responses for at least **one release** after the deprecation is announced in [CHANGELOG](../CHANGELOG.md) and the API reference. Fields still read by the bundled SPA need **at least two releases** — see [Removal criteria](#removal-criteria) below.
10
+
4.**SPA and scripts.** Update `static/js/*.js` and any internal callers before removing a field.
11
+
12
+
## How we announce deprecation
13
+
14
+
| Channel | What to update |
15
+
|---------|----------------|
16
+
| CHANGELOG |`### Deprecated` under the release that announces the change |
17
+
| API reference | Set field stability to `deprecated` with a short note and replacement |
18
+
| Response (optional) | Future: `Deprecation` header or JSON `_deprecated` map — not required today |
19
+
20
+
## Removal criteria
21
+
22
+
A deprecated field may be removed when:
23
+
24
+
- At least one release has shipped with the field still present but documented as deprecated, and
25
+
- The bundled SPA no longer reads the field, and
26
+
- Tests and CHANGELOG document the removal.
27
+
28
+
For fields actively read by the bundled SPA (which does not track an external API version), removal happens no earlier than **two tagged releases** after the release that documented the deprecation in CHANGELOG (for example, deprecated in `0.1.0`, removable from `0.3.0` at earliest when versions advance `0.1.0` → `0.2.0` → `0.3.0`), and no earlier than **14 calendar days** after that deprecation announcement.
Release versions follow `MAJOR.MINOR.PATCH` in `app.__version__` and [CHANGELOG](../CHANGELOG.md). Until the first git tag ships, `main` may carry a `.dev0` suffix (for example `0.1.0.dev0`); the CHANGELOG `[Unreleased]` section is the source of truth for what is not yet tagged.
39
+
40
+
| Bump | Pre-1.0 meaning |
41
+
|------|-----------------|
42
+
|**Patch**| Bug fixes and documentation; no intentional API removals |
43
+
|**Minor**| Additive API/features; deprecations may be announced |
44
+
|**Major**| Reserved for the `1.0.0` line and later: signals a stable HTTP JSON contract for external integrators and may include breaking removals that completed their deprecation period |
45
+
46
+
While the project is pre-1.0, treat **minor** bumps as the usual vehicle for deprecations and **patch** bumps for safe fixes.
0 commit comments