Skip to content

Commit e1a7edb

Browse files
authored
Merge pull request #125 from jsilvanus/claude/subagents-deploy-142-148-dhe3mq
Claude/subagents deploy 142 148 dhe3mq
2 parents 3fd799d + a5aa847 commit e1a7edb

11 files changed

Lines changed: 172 additions & 222 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitsema": minor
3+
---
4+
5+
Removed the `tools lsp --tcp` transport entirely (previously deprecated in Phase 120 in favor of `--websocket --key`): raw TCP had no authentication mechanism at all, and nothing in the test suite exercised it. `gitsema tools lsp`/`gitsema lsp` are now stdio or `--websocket` only — use `--websocket <bind-address> --key <token>` for network-reachable LSP access.

CLAUDE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Preferred entry point for all long-running protocol servers. Subcommands:
257257
| Subcommand | Description |
258258
|---|---|
259259
| `gitsema tools mcp` | Start the MCP stdio server (AI tool interface) |
260-
| `gitsema tools lsp [--tcp <port>]` | Start the LSP semantic hover server (JSON-RPC over stdio or TCP; `--tcp` is deprecated, use `--websocket`) |
260+
| `gitsema tools lsp [--websocket <bind-address>]` | Start the LSP semantic hover server (JSON-RPC over stdio or WebSocket) |
261261
| `gitsema tools serve [--port n] [--key token] [--ui]` | Start the HTTP API server (remote embedding backend) |
262262

263263
The old top-level `gitsema mcp`, `gitsema lsp`, and `gitsema serve` still work as hidden backward-compat aliases.
@@ -395,7 +395,7 @@ git repo
395395
│ chattydeerProvider.ts, cliProvider.ts, cliAdapters.ts — HTTP / local-CLI LLM backends
396396
│ redact.ts — secret/PII redaction applied to all outbound LLM content
397397
[ src/core/llm/ ] narrator.ts — system-prompt builders shared by narrator/guide/skill generator
398-
[ src/core/lsp/ ] server.ts — JSON-RPC semantic hover server (stdio, `--websocket`, or deprecated `--tcp`)
398+
[ src/core/lsp/ ] server.ts — JSON-RPC semantic hover server (stdio or `--websocket`)
399399
[ src/core/viz/ ] htmlRenderer*.ts — interactive HTML output for evolution/search/clusters/map
400400
[ src/core/models/ ] types.ts — shared embedding/result type definitions
401401
@@ -694,4 +694,3 @@ For the full list of gaps and planned work, see [`docs/PLAN.md`](docs/PLAN.md) a
694694
| Gap | Notes |
695695
|---|---|
696696
| **Python model server** | Docker image and Dockerfile provided to avoid local Rust/wheel issues on Windows; use Docker to run the modelserver. |
697-
| **Deprecated `tools lsp --tcp`** | No Bearer-token mechanism at all (review10 §3.5), unlike `--websocket`/`--http` which support `--key`/`GITSEMA_WEBSOCKET_KEY`/`GITSEMA_MCP_HTTP_KEY` — raw TCP has no header to carry a token in. Deprecated in favor of `--websocket` (Phase 120) rather than given a bespoke handshake-auth protocol; a deprecation warning is printed on every invocation, but the flag still works and is not yet scheduled for removal. |

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Copies the active index into another storage backend (sqlite/postgres/qdrant) vi
185185
| Command | Description |
186186
|---|---|
187187
| `gitsema tools mcp [--remote <url>] [--remote-key <token>] [--remote-timeout <ms>] [--websocket <bind-address>] [--http <bind-address>] [--key <token>]` | Start the MCP stdio server (AI tool interface) |
188-
| `gitsema tools lsp [--tcp <port>] [--websocket <bind-address>] [--key <token>] [--remote <url>] [--remote-key <token>] [--remote-timeout <ms>] [--diagnostics]` | Start the LSP semantic hover server (JSON-RPC over stdio, TCP, or WebSocket)`--tcp` is deprecated, use `--websocket` |
188+
| `gitsema tools lsp [--websocket <bind-address>] [--key <token>] [--remote <url>] [--remote-key <token>] [--remote-timeout <ms>] [--diagnostics]` | Start the LSP semantic hover server (JSON-RPC over stdio or WebSocket) |
189189
| `gitsema tools serve [--port n] [--key token] [--ui]` | Start the HTTP API server (remote embedding backend) |
190190

191191
The old top-level `gitsema mcp`, `gitsema lsp`, and `gitsema serve` still work as hidden backward-compat aliases.
@@ -210,7 +210,7 @@ server-push notification and remote delegation is request/response-only).
210210

211211
**WebSocket transport (Phase 116):** `--websocket <bind-address>` (e.g.
212212
`--websocket 0.0.0.0:4242`) listens on a fixed `/mcp` or `/lsp` path instead of
213-
stdio/TCP. `--key <token>` requires a matching `Authorization: Bearer <token>`
213+
stdio. `--key <token>` requires a matching `Authorization: Bearer <token>`
214214
header on the WS upgrade request, falling back to `GITSEMA_WEBSOCKET_KEY` if
215215
`--key` is omitted (shared by `tools mcp --websocket` and `tools lsp
216216
--websocket`); gitsema does not terminate TLS, so put a reverse proxy in front
@@ -234,13 +234,6 @@ response/request header), capped at 100 concurrent sessions; request bodies
234234
are capped the same way as `tools serve` (`GITSEMA_MAX_BODY_SIZE`, default
235235
1mb). Binding a non-loopback host without a key prints a startup warning.
236236

237-
**`--tcp` is deprecated:** `tools lsp --tcp` has no authentication mechanism at
238-
all (unlike `--websocket`/`--http`), and raw TCP has no header to carry a
239-
bearer token in — any client that can reach the port gets full LSP access. Use
240-
`--websocket <bind-address> --key <token>` instead, which covers the same
241-
network-LSP use case with working auth. A deprecation warning is printed on
242-
every `--tcp` invocation; the flag is not yet scheduled for removal.
243-
244237
`gitsema tools serve` defaults `POST /api/v1/remote/index` to **persistent** mode:
245238
the cloned repo and its index are stored under `GITSEMA_DATA_DIR` (default
246239
`~/.gitsema/data`) and reused on subsequent requests (fetch + incremental index

docs/PLAN.md

Lines changed: 62 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115
| [Phase 97 — Full-toolset guide, tool interpretation registry, skill generation, Ollama docs](#phase-97-—-full-toolset-guide-tool-interpretation-registry-skill-generation-ollama-docs) | 3281 |
116116
| [Phase 98 — CLI-based AI tool backends for narrator/guide](#phase-98-—-cli-based-ai-tool-backends-for-narratorguide) | 3342 |
117117
| [Phase 99 — `--provider ollama` for narrator/guide + Ollama model discovery](#phase-99-—-provider-ollama-for-narratorguide-ollama-model-discovery) | 3406 |
118-
| [Long-Term Investments](#long-term-investments) | 3447 |
119-
| [Non-goals for now (revisited later)](#non-goals-for-now-revisited-later) | 3464 |
120118
| [Phase 100 — Persistent, registry-backed server-side repo storage](#phase-100-—-persistent-registry-backed-server-side-repo-storage) | 3472 |
121119
| [Phases 101–103 — Pluggable storage backends & index scoping](#phases-101–103-—-pluggable-storage-backends-index-scoping) | 3540 |
122120
| [Phase 104 — Full-toolset guide coverage, per-command `--narrate`, and a guided `gitsema setup` wizard](#phase-104-—-full-toolset-guide-coverage-per-command-narrate-and-a-guided-gitsema-setup-wizard) | 3742 |
@@ -3457,31 +3455,6 @@ is given.
34573455

34583456
**Status:** ✅ complete.
34593457

3460-
## Long-Term Investments
3461-
3462-
| Feature | Complexity | Notes |
3463-
|---------|:----------:|-------|
3464-
| Plugin API for custom analysers | High | Allow third-party modules to register their own search/analysis commands |
3465-
3466-
> **Note:** the "pgvector migration path for >500K blobs" item formerly listed
3467-
> here was implemented by Phases 101-103 (`storage.backend=postgres\|qdrant`,
3468-
> see [Phases 101-103](#phases-101–103-—-pluggable-storage-backends-index-scoping)).
3469-
> SQLite remains the default for new projects.
3470-
3471-
**Scale notes (updated for v0.81.0):**
3472-
3473-
- **Search memory:** auto early-cut (Phase 82) now guards the default search path — reservoir sampling kicks in at 50 K candidates without any flags. ANN path (`gitsema index build-vss`) eliminates the candidate-load entirely for large indexes.
3474-
- **Indexing time:** commit-message embedding is now parallelised (Phase 83). The read/embed/store pipeline (Phase 69) + parallel commit embedding together keep both phases off the critical path. The remaining serial bottleneck is commit-graph walking itself (git rev-list) which is I/O-bound.
3475-
- **Chunk/symbol candidate expansion:** when `--chunks` or `--vss` is combined with a large index the candidate pool grows 3–10× before scoring. Monitor RSS when indexing large monorepos with `--chunker function`.
3476-
3477-
## Non-goals for now (revisited later)
3478-
3479-
| Feature | Reasoning |
3480-
|---------|:----------:|-------|
3481-
| Python model server (GPU Docker) | We already have Node.js embedeer and if we want Docker+python, we can use ollama. |
3482-
3483-
---
3484-
34853458
### Phase 100 — Persistent, registry-backed server-side repo storage
34863459

34873460
**Goal:** Make `gitsema tools serve`'s `POST /api/v1/remote/index` persist cloned
@@ -6043,6 +6016,68 @@ detail):
60436016

60446017
---
60456018

6019+
### Phase 149 — Remove `tools lsp --tcp`
6020+
6021+
**Design:** no separate design doc — scoped directly from a `/whatnext`
6022+
audit finding: review10 §3.5 flagged `tools lsp --tcp` as an unauthenticated
6023+
network transport (raw TCP has no header to carry a Bearer token in), Phase
6024+
120 deprecated it in favor of `--websocket --key` rather than fixing it, and
6025+
Phase 120's own entry explicitly floated removal as "a separate,
6026+
explicitly-scheduled future phase once usage data/feedback suggests it's
6027+
safe." The audit confirmed no test in the suite exercises `--tcp` or
6028+
`startLspTcpServer` (`grep -rln "startLspTcpServer\|--tcp" tests/` returns
6029+
nothing), so removal is a clean cut with no test fallout to reconcile.
6030+
6031+
**Goal:** Actually remove the `--tcp <port>` transport (not just deprecate
6032+
it further) from `gitsema tools lsp` and the legacy `gitsema lsp` alias,
6033+
closing the unauthenticated-transport gap by deleting the surface entirely
6034+
rather than continuing to carry it forward.
6035+
6036+
**Scope:**
6037+
1. Removed the `--tcp <port>` Commander option and its handling from `tools
6038+
lsp` (`src/cli/commands/tools.ts`) and the top-level `gitsema lsp`
6039+
backward-compat alias (`src/cli/commands/lsp.ts`).
6040+
2. Removed `startLspTcpServer()` from `src/core/lsp/server.ts`, along with
6041+
the now-unused `node:net` `createServer` import that only existed to
6042+
support it.
6043+
3. Deleted the `gitsema tools lsp --tcp <port>` row from
6044+
`docs/deprecations.md` §1 (hard deprecations) per that file's own stated
6045+
policy — "delete its row only after the removal has actually shipped" —
6046+
and bumped its "Last updated" date.
6047+
4. Updated `README.md`, `docs/features.md`, `docs/parity.md`, and
6048+
`CLAUDE.md` to remove `--tcp` references: README's and features.md's
6049+
`tools lsp` command-reference rows now read `[--websocket
6050+
<bind-address>] [--key <token>] ...` with no TCP mention;
6051+
`docs/parity.md`'s §0 transport table, legend, and flag-coherence rows
6052+
for `tools lsp` drop the `--tcp` column entirely (LSP is now stdio or
6053+
`--websocket` only, matching MCP's existing stdio/`--websocket`/`--http`
6054+
pattern); `CLAUDE.md`'s "Known gaps & future phases" table entry, which
6055+
previously described `--tcp` as an open, deprecated gap, now describes
6056+
the removal instead.
6057+
5. Added `.changeset/remove-lsp-tcp-transport.md` (`minor` severity,
6058+
following this repo's established precedent of using `minor` rather than
6059+
`major` for breaking changes pre-1.0 — see `.changeset/deprecate-lsp-tcp.md`
6060+
and `.changeset/author-http-route-parity.md`).
6061+
6062+
**Acceptance criteria:**
6063+
- `gitsema tools lsp --tcp <port>` and `gitsema lsp --tcp <port>` no longer
6064+
parse as valid invocations (Commander has no `--tcp` option registered).
6065+
- `startLspTcpServer` no longer exists anywhere in `src/`.
6066+
- `docs/deprecations.md` no longer lists `--tcp` in §1.
6067+
- `README.md`/`docs/features.md`/`docs/parity.md`/`CLAUDE.md` describe LSP
6068+
as available over stdio or `--websocket` only.
6069+
- `pnpm build && pnpm test` clean — no test referenced `--tcp` or
6070+
`startLspTcpServer` before this change, so this is a clean removal.
6071+
6072+
**Files touched:** `src/cli/commands/tools.ts`, `src/cli/commands/lsp.ts`,
6073+
`src/core/lsp/server.ts`, `docs/deprecations.md`, `README.md`,
6074+
`docs/features.md`, `docs/parity.md`, `CLAUDE.md`, `docs/PLAN.md`,
6075+
`.changeset/remove-lsp-tcp-transport.md`.
6076+
6077+
**Status:** ✅ complete.
6078+
6079+
---
6080+
60466081
## Deployment scenarios & usage envisioning
60476082

60486083
The architecture of gitsema supports three distinct deployment scenarios, each with different operational models and target users. This section clarifies the intended usage patterns and the infrastructure requirements for each.

docs/deprecations.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Canonical list of every deprecated command, flag, and transport in gitsema:
44
what replaced it, when it was deprecated, and whether (and when) it's
55
scheduled for removal.
66

7-
**Last updated:** 2026-07-01
7+
**Last updated:** 2026-07-02
88

99
**Removal policy:** gitsema has never set a removal date for anything in this
1010
file. Every hard deprecation below has been kept indefinitely since it was
@@ -37,7 +37,6 @@ functional — the warning is the only behavior change.
3737
| `gitsema clear-model` | `gitsema index clear-model` | Phase 71 (v0.71.0) | Not scheduled | `src/cli/register/indexing.ts:315-318` |
3838
| `gitsema build-vss` | `gitsema index build-vss` | Phase 71 (v0.71.0) | Not scheduled | `src/cli/register/indexing.ts:324-329` |
3939
| `gitsema policy check` (two-word) | `gitsema policy-check` (kebab-case) | Phase 94 (v0.91.0) | Not scheduled | `src/cli/register/analysis.ts:63-75` |
40-
| `gitsema tools lsp --tcp <port>` | `gitsema tools lsp --websocket <bind-address> --key <token>` | Phase 120 | Not scheduled (raw TCP has no header to carry a Bearer token in — see §3) | `src/cli/commands/tools.ts:92,126-133` |
4140
| `POST /api/v1/analysis/multi-repo-search` | `POST /api/v1/search` with a `repos: string[]` body param | Phase 138 | Not scheduled | `src/server/routes/analysis.ts` (`multi-repo-search` handler); response carries a `Deprecation: true` header + a `Link: </api/v1/search>; rel="successor-version"` header on every call instead of a stderr warning (this is an HTTP route, not a CLI command) |
4241

4342
`POST /analysis/multi-repo-search`'s bare 4-param shape (`query`, `repoIds`,

0 commit comments

Comments
 (0)