Skip to content

Commit ab1bb2e

Browse files
docs: address PR review on debug guard scope and deprecation wording
1 parent d7f4701 commit ab1bb2e

6 files changed

Lines changed: 12 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
2121

2222
- `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).
2323

24-
[0.1.0]: https://github.com/cppalliance/claude-code-chat-browser/releases/tag/v0.1.0
24+
[0.1.0]: https://github.com/cppalliance/claude-code-chat-browser/releases

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Useful flags:
4141
- `--base-dir PATH` — point at a different `projects/` tree (for tests or fixtures)
4242
- `--exclude-rules PATH` — session exclusion rules file
4343
- `--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 at startup)
44+
- `--debug` — Flask/Werkzeug debug mode (loopback hosts only; enforced when starting via `python app.py`, not `flask run` or WSGI)
4545

4646
## API and release policy
4747

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ python app.py --base-dir /path/to/claude/projects
6767
> which allows arbitrary code execution from any browser that can reach the server.
6868
> For typical local browsing, keep the default `--host 127.0.0.1` and omit `--debug`.
6969
> The server **refuses to start** if `--debug` is combined with a non-loopback `--host` (e.g. `0.0.0.0`).
70+
> That check runs only when you start the app with **`python app.py`** (not via `flask run` or other WSGI entrypoints).
7071
7172
### CLI Export
7273

app.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
1616

1717

1818
def is_loopback_host(host: str) -> bool:
19-
"""True if ``host`` binds only to the local machine (safe with ``--debug``)."""
19+
"""True if ``host`` binds only to the local machine (safe with ``--debug``).
20+
21+
Accepts ``127.0.0.1``, ``localhost``, ``::1``, and other ``127.x.x.x`` addresses.
22+
Rejects all-interfaces forms such as ``0.0.0.0`` and bare ``::`` (not loopback).
23+
"""
2024
h = (host or "").strip().lower()
2125
if h in ("127.0.0.1", "localhost", "::1"):
2226
return True

docs/deprecation-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This document defines how **claude-code-chat-browser** evolves its HTTP JSON API
66

77
1. **Documented fields are a contract.** See [API reference](api-reference.md) — each field is marked `stable`, `experimental`, or `deprecated`.
88
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.
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.
1010
4. **SPA and scripts.** Update `static/js/*.js` and any internal callers before removing a field.
1111

1212
## How we announce deprecation

tests/test_cli_args.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,10 @@ def test_is_loopback_host_accepts_loopback(self, host: str) -> None:
340340
def test_is_loopback_host_rejects_non_loopback(self, host: str) -> None:
341341
assert not is_loopback_host(host)
342342

343-
def test_validate_startup_cli_allows_loopback_debug(self) -> None:
343+
@pytest.mark.parametrize("host", ["127.0.0.1", "localhost"])
344+
def test_validate_startup_cli_allows_loopback_debug(self, host: str) -> None:
344345
parser = build_cli_parser()
345-
args = parser.parse_args(["--host", "127.0.0.1", "--debug"])
346+
args = parser.parse_args(["--host", host, "--debug"])
346347
validate_startup_cli(args)
347348

348349
def test_validate_startup_cli_rejects_non_loopback_debug(

0 commit comments

Comments
 (0)