synap-git 2.3.0__tar.gz → 2.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {synap_git-2.3.0 → synap_git-2.3.1}/.gitignore +1 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/CHANGELOG.md +15 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/PKG-INFO +133 -107
- {synap_git-2.3.0 → synap_git-2.3.1}/README.md +132 -106
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/__init__.py +1 -1
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/main.py +37 -5
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/git/state.py +64 -40
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/indexer/engine.py +27 -3
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/indexer/scanner.py +2 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/.synap.example/README.md +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/LICENSE.md +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/pyproject.toml +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/api/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/api/app.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/api/static/index.html +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/__main__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/checkpoint.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/lessons.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/memory.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/usage.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/cli/wiki.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/config.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/diagnostics/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/diagnostics/logger.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/diagnostics/tracing.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/embeddings/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/git/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/indexer/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/indexer/daemon.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/indexer/wiki.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/mcp/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/mcp/server.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/parser/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/parser/registry.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/anthropic.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/base.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/factory.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/gemini.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/ollama.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/openai.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/provider/openrouter.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/py.typed +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/retrieval/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/retrieval/engine.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/retrieval/memory.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/security/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/security/redactor.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/security/sanitizer.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/security/validator.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/storage/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/storage/sqlite.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/utils/__init__.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/src/synap_git/utils/serialization.py +0 -0
- {synap_git-2.3.0 → synap_git-2.3.1}/website/README.md +0 -0
|
@@ -7,19 +7,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [2.2.0] - 2026-08-03
|
|
9
9
|
|
|
10
|
+
## [2.3.1] - 2026-08-03
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Git state detection**: normalized branch resolution and improved dirty-state detection during runtime bootstrap.
|
|
15
|
+
- **Incremental indexing**: skipped reindex when HEAD commit is already indexed to restore zero-change performance.
|
|
16
|
+
|
|
17
|
+
### Chore
|
|
18
|
+
|
|
19
|
+
- **Bumped package version** to `2.3.1`.
|
|
20
|
+
|
|
10
21
|
## [2.3.0] - 2026-08-03
|
|
11
22
|
|
|
12
23
|
### Added
|
|
24
|
+
|
|
13
25
|
- **CLI Cost & Usage Command**: Expose `synap cost` (alias `synap usage`) to show aggregated LLM calls, token counts, and estimated USD cost in the terminal.
|
|
14
26
|
- **Web UI: CLI Cost Integration**: The website CLI playground now surfaces an estimated cost line for sample commands so visitors can see token/cost economics.
|
|
15
27
|
|
|
16
28
|
### Changed
|
|
29
|
+
|
|
17
30
|
- **Frontend Defensive Rendering**: Guarded several UI paths against undefined symbol objects to prevent runtime errors in production (fixed `.type` property reads).
|
|
18
31
|
|
|
19
32
|
### Chore
|
|
33
|
+
|
|
20
34
|
- **Bumped package version** to `2.3.0`.
|
|
21
35
|
- **Release automation**: prepared changelog and release tag for GitHub release `v2.3.0`.
|
|
22
36
|
|
|
37
|
+
## [2.2.0] - 2026-08-03
|
|
23
38
|
|
|
24
39
|
### Added
|
|
25
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: synap-git
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.1
|
|
4
4
|
Summary: Persistent structural context infrastructure for AI coding agents.
|
|
5
5
|
Project-URL: Homepage, https://github.com/saahilpal/synapse
|
|
6
6
|
Project-URL: Repository, https://github.com/saahilpal/synapse
|
|
@@ -108,31 +108,32 @@ Synap coordinates local repository scanning, graph storage, wiki rendering, and
|
|
|
108
108
|
└──────────────────────────┘
|
|
109
109
|
```
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
111
|
+
- **synap_git.cli** — Mounts Typer subcommands for configuration, database repair, logs tailing, and service management.
|
|
112
|
+
- **synap_git.indexer.daemon** — Runs the background loop tracking commit shifts and processes asynchronous documentation tasks.
|
|
113
|
+
- **synap_git.api.app** — Serves REST endpoints for system metrics, LLM call logging, and diagnostic event streams.
|
|
114
|
+
- **synap_git.git.state** — Extracts Git commit OIDs, untracked changes status, and branch indicators.
|
|
115
|
+
- **synap_git.indexer.engine** — Orchestrates parallel file parsing, AST traversal, and database serialization.
|
|
116
|
+
- **synap_git.parser.registry** — Parses language-specific grammar using Tree-sitter.
|
|
117
|
+
- **synap_git.storage.sqlite** — Controls SQLite databases, Write-Ahead Logging (WAL), and FTS5 search indexing.
|
|
118
|
+
- **synap_git.indexer.wiki** — Generates file, module, and project markdown documentation summaries.
|
|
119
|
+
- **synap_git.retrieval.engine** — Controls lexical, structural, and semantic search queries with token budgeting.
|
|
120
|
+
- **synap_git.mcp.server** — Serves Model Context Protocol commands via stdio.
|
|
121
121
|
|
|
122
122
|
### The Layer Model
|
|
123
123
|
|
|
124
124
|
Synap isolates structural truth from non-deterministic summaries through three defined layers:
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
- **L1 (Structural Graph):** Tree-sitter parsers convert code files to AST symbols and import dependencies. Imports map caller-callee relations in a database graph, fully regeneratable from HEAD.
|
|
127
|
+
- **L2 (Semantic Wiki):** Asynchronous background prompts construct markdown summaries of files and modules. Missing pages are resolved on-demand through lazy loading.
|
|
128
|
+
- **L3 (Behavioral Memory):** Stored checkpoints, technical decisions, and lessons persist through branch swaps and index rollbacks.
|
|
129
129
|
|
|
130
130
|
### Runtime Topology
|
|
131
131
|
|
|
132
132
|
On daemon execution, Synap hosts all services in a single process using the asyncio event loop:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
|
|
134
|
+
- **Git Watcher Loop:** Polls repository state every 2 seconds. Identifies branch switches, commit additions, merges, and reverts.
|
|
135
|
+
- **Uvicorn Server:** Hosts the REST API and HTML dashboard on port 9876.
|
|
136
|
+
- **Wiki Worker Task:** Listens to `wiki_queue` changes, generating summaries using LLM calls.
|
|
136
137
|
|
|
137
138
|
### Data Flow
|
|
138
139
|
|
|
@@ -243,11 +244,13 @@ llm_calls
|
|
|
243
244
|
file_path TEXT associated file path if applicable
|
|
244
245
|
created_at INTEGER unix epoch timestamp
|
|
245
246
|
```
|
|
246
|
-
|
|
247
|
+
|
|
248
|
+
_Note: Schema versioning is managed via `user_version` pragmas (currently version 3)._
|
|
247
249
|
|
|
248
250
|
### Indexing Pipeline
|
|
249
251
|
|
|
250
252
|
Indexing translates source trees to SQLite relations:
|
|
253
|
+
|
|
251
254
|
1. **Bootstrap Check:** Compares HEAD commit hash with database records. Passes execution to first-run indexing if blank, or incremental indexing if commit history matches.
|
|
252
255
|
2. **First-run Indexing:** Parses all files. Files are split into chunks of 500. `ProcessPoolExecutor` uses all available CPU cores to execute AST parsing in parallel.
|
|
253
256
|
3. **AST Symbol Extraction:** Tree-sitter parsers process code bytes. Traversal scripts register functions and classes.
|
|
@@ -258,6 +261,7 @@ Indexing translates source trees to SQLite relations:
|
|
|
258
261
|
### Retrieval Design
|
|
259
262
|
|
|
260
263
|
Retrieval uses a four-stage hybrid query execution loop:
|
|
264
|
+
|
|
261
265
|
1. **Temporal Selection:** Filters data based on active branch state.
|
|
262
266
|
2. **Lexical Searching:** Queries terms using `symbols_fts` MATCH indexing, starting candidate scores at `1.0`.
|
|
263
267
|
3. **Structural Expansion:** Traverses neighbors up to 2 hops away using SQLite recursive CTEs. Neighbors receive a starting score of `0.8^distance`.
|
|
@@ -267,34 +271,41 @@ Retrieval uses a four-stage hybrid query execution loop:
|
|
|
267
271
|
|
|
268
272
|
MCP server communicates via stdio, packaging database actions under a JSON envelope.
|
|
269
273
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
274
|
+
- **`get_status`** — Returns indexing counts, branch details, and HEAD commit hashes.
|
|
275
|
+
- **`search`** (inputs: `query` string, `max_tokens` integer) — Returns ranked context blocks and latency timelines.
|
|
276
|
+
- **`create_checkpoint`** (inputs: `doing` string, `changed_files` list, `next_step` string, `blockers` string) — Registers new thought snapshot.
|
|
277
|
+
- **`restore_checkpoint`** — Returns the latest checkpoint detail for the active branch.
|
|
278
|
+
- **`log_decision`** (inputs: `content` string, `context_info` string) — Logs architectural decisions.
|
|
279
|
+
- **`verify_system`** — Performs SQLite quick checks.
|
|
280
|
+
- **`submit_lesson_analysis`** (inputs: `lesson_id` string, `why_failed` string) — Saves lesson details under pending status.
|
|
281
|
+
- **`get_approved_memory`** — Returns active approved memory lessons.
|
|
282
|
+
- **`get_pending_memory`** — Returns pending lessons awaiting approval.
|
|
283
|
+
- **`signal_low_context`** (inputs: `token_count` integer, `capacity` integer) — Asserts window usage thresholds, recommending checkpoints if needed.
|
|
280
284
|
|
|
281
285
|
### Key Algorithms
|
|
282
286
|
|
|
283
287
|
#### Revert Detection
|
|
288
|
+
|
|
284
289
|
When the daemon watcher registers a checkout transition, it runs:
|
|
290
|
+
|
|
285
291
|
```bash
|
|
286
292
|
git log -n 1 --pretty=format:%s
|
|
287
293
|
```
|
|
294
|
+
|
|
288
295
|
If the commit message starts with `"Revert "`, Synap parses the commit message to extract the reverted commit hash. It runs `git show --name-only` to identify affected paths and inserts a pending lesson row.
|
|
289
296
|
|
|
290
297
|
#### Context Packing
|
|
298
|
+
|
|
291
299
|
Context is packed using `tiktoken`'s `cl100k_base` tokenizer.
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
300
|
+
|
|
301
|
+
- Enforces limit of `max_tokens - 600` (reserves 600 tokens for instructions).
|
|
302
|
+
- Appends active approved memory lessons under `# APPROVED SYSTEM MEMORY`.
|
|
303
|
+
- Formats code blocks sequentially. Candidate elements exceeding the remaining budget are truncated.
|
|
295
304
|
|
|
296
305
|
#### Graph CTE Traversal
|
|
306
|
+
|
|
297
307
|
Recursively traverses dependencies using SQLite SQL CTEs:
|
|
308
|
+
|
|
298
309
|
```sql
|
|
299
310
|
WITH RECURSIVE neighborhood(id, d) AS (
|
|
300
311
|
SELECT ? as id, 0 as d
|
|
@@ -315,39 +326,49 @@ ORDER BY n.d ASC
|
|
|
315
326
|
## Install
|
|
316
327
|
|
|
317
328
|
Install the python package:
|
|
329
|
+
|
|
318
330
|
```bash
|
|
319
331
|
pip install synap-git
|
|
320
332
|
```
|
|
321
333
|
|
|
322
334
|
### System Requirements
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
335
|
+
|
|
336
|
+
- Python >= 3.11
|
|
337
|
+
- Git Command Line Tool
|
|
338
|
+
- SQLite (compiled with FTS5 virtual table support)
|
|
326
339
|
|
|
327
340
|
---
|
|
328
341
|
|
|
329
342
|
## Quick Start
|
|
330
343
|
|
|
331
344
|
### 1. Setup LLM Credentials
|
|
345
|
+
|
|
332
346
|
Run interactive configuration to configure your model:
|
|
347
|
+
|
|
333
348
|
```bash
|
|
334
349
|
synap setup .
|
|
335
350
|
```
|
|
336
351
|
|
|
337
352
|
### 2. Run Ingestion
|
|
353
|
+
|
|
338
354
|
Initialize the local SQLite database index:
|
|
355
|
+
|
|
339
356
|
```bash
|
|
340
357
|
synap init .
|
|
341
358
|
```
|
|
342
359
|
|
|
343
360
|
### 3. Connect IDE / Start MCP
|
|
361
|
+
|
|
344
362
|
Launch the unified background daemon and MCP stdio server:
|
|
363
|
+
|
|
345
364
|
```bash
|
|
346
365
|
synap start .
|
|
347
366
|
```
|
|
348
367
|
|
|
349
368
|
### 4. Connect IDE
|
|
369
|
+
|
|
350
370
|
Generate configuration settings:
|
|
371
|
+
|
|
351
372
|
```bash
|
|
352
373
|
synap mcp config .
|
|
353
374
|
```
|
|
@@ -358,36 +379,37 @@ synap mcp config .
|
|
|
358
379
|
|
|
359
380
|
All commands support target path arguments:
|
|
360
381
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
382
|
+
- `synap setup [PATH]` — Runs provider configuration wizard.
|
|
383
|
+
- `synap init [PATH]` — Performs initial structural indexing. Supports `--skip-llm`, `--skip-wiki`.
|
|
384
|
+
- `synap wipe [PATH]` — Purges SQLite index.
|
|
385
|
+
- `synap start [PATH]` — Launches background daemon.
|
|
386
|
+
- `synap stop [PATH]` — Terminate background daemon.
|
|
387
|
+
- `synap restart [PATH]` — Restarts background daemon.
|
|
388
|
+
- `synap status [PATH]` — Prints active indexing parameters. Supports `--json`.
|
|
389
|
+
- `synap logs` — Views system logs. Supports `-t`, `-n`, `-d`.
|
|
390
|
+
- `synap update` — Upgrades Synap installation.
|
|
391
|
+
- `synap version` — Prints version.
|
|
392
|
+
- `synap rollback [PATH]` — Restores index state to previous commit. Supports `-c`, `-y`.
|
|
393
|
+
- `synap repair [PATH]` — Wipes index and rebuilds from HEAD. Supports `-y`.
|
|
394
|
+
- `synap doctor [PATH]` — Verifies database integrity and parsers.
|
|
395
|
+
- `synap run [PATH]` — Runs daemon in foreground.
|
|
396
|
+
- `synap ui [PATH]` — Launches HTML dashboard.
|
|
397
|
+
- `synap mcp config [PATH]` — Outputs Cursor connection blocks.
|
|
398
|
+
- `synap mcp verify [PATH]` — Asserts MCP server stability.
|
|
399
|
+
- `synap memory status [PATH]` — Lists lesson counts.
|
|
400
|
+
- `synap memory prune [PATH]` — Evaluates and deletes expired lessons.
|
|
401
|
+
- `synap memory verify [PATH]` — Checks lessons for missing files. Supports `--json`.
|
|
402
|
+
- `synap lessons approve <ID> [PATH]` — Approves a pending lesson.
|
|
403
|
+
- `synap lessons reject <ID> [PATH]` — Rejects a lesson.
|
|
404
|
+
- `synap lessons review [PATH]` — Launches interactive lesson review console.
|
|
405
|
+
- `synap checkpoint create [PATH]` — Logs progress snapshot. Supports `--doing`, `--files`, `--next-step`, `--blockers`.
|
|
406
|
+
- `synap checkpoint list [PATH]` — Renders checkpoint tables.
|
|
407
|
+
- `synap checkpoint restore <ID> [PATH]` — Displays checkpoint records.
|
|
408
|
+
- `synap usage show [PATH]` — Renders token metrics.
|
|
409
|
+
- `synap usage clear [PATH]` — Clears LLM call logs.
|
|
410
|
+
- `synap cost [PATH]` — Shows aggregated LLM calls, token counts, and estimated USD cost (alias for `synap usage show`).
|
|
411
|
+
- `synap wiki list [PATH]` — Lists generated docs.
|
|
412
|
+
- `synap wiki show <FILE> [PATH]` — Renders wiki files.
|
|
391
413
|
|
|
392
414
|
---
|
|
393
415
|
|
|
@@ -395,46 +417,48 @@ All commands support target path arguments:
|
|
|
395
417
|
|
|
396
418
|
Configuration values are parsed from `~/.config/synap/config.toml`.
|
|
397
419
|
|
|
398
|
-
| Field Name
|
|
399
|
-
|
|
|
400
|
-
| `profile`
|
|
401
|
-
| `mode`
|
|
402
|
-
| `repository_path`
|
|
403
|
-
| `state_path`
|
|
404
|
-
| `sqlite_path`
|
|
405
|
-
| `object_path`
|
|
406
|
-
| `log_path`
|
|
407
|
-
| `logging_mode`
|
|
408
|
-
| `log_level`
|
|
409
|
-
| `max_file_bytes`
|
|
410
|
-
| `checkpoint_threshold`
|
|
411
|
-
| `lesson_expiry_days`
|
|
412
|
-
| `llm_provider`
|
|
413
|
-
| `llm_model`
|
|
414
|
-
| `ollama_url`
|
|
415
|
-
| `mcp_host`
|
|
416
|
-
| `mcp_port`
|
|
417
|
-
| `daemon_poll_interval_seconds` | `float`
|
|
418
|
-
| `shutdown_timeout_seconds`
|
|
420
|
+
| Field Name | Type | Default | Description |
|
|
421
|
+
| :----------------------------- | :-------- | :------------------------- | :---------------------------------------------------------------------------- |
|
|
422
|
+
| `profile` | `string` | `"dev"` | Active environment configuration profile. |
|
|
423
|
+
| `mode` | `string` | `"active"` | Watcher polling mode selector. |
|
|
424
|
+
| `repository_path` | `string` | `"."` | Repository root directory. |
|
|
425
|
+
| `state_path` | `string` | `".synap"` | Root storage path. |
|
|
426
|
+
| `sqlite_path` | `string` | `".synap/synap.db"` | Database file location. |
|
|
427
|
+
| `object_path` | `string` | `".synap/objects"` | Directory for serialized artifacts. |
|
|
428
|
+
| `log_path` | `string` | `".synap/logs"` | Directory for logs. |
|
|
429
|
+
| `logging_mode` | `string` | `"human"` | Log output format type. |
|
|
430
|
+
| `log_level` | `string` | `"INFO"` | Minimum logging level threshold. |
|
|
431
|
+
| `max_file_bytes` | `integer` | `1000000` | Size threshold for parsed files. |
|
|
432
|
+
| `checkpoint_threshold` | `float` | `0.60` | Threshold ratio for memory warnings. |
|
|
433
|
+
| `lesson_expiry_days` | `integer` | `7` | Days before memory lessons expire. |
|
|
434
|
+
| `llm_provider` | `string` | `null` | Generative provider: `openai`, `gemini`, `anthropic`, `ollama`, `openrouter`. |
|
|
435
|
+
| `llm_model` | `string` | `null` | Named model used for prompts. |
|
|
436
|
+
| `ollama_url` | `string` | `"http://127.0.0.1:11434"` | Endpoint URL for Ollama connectivity. |
|
|
437
|
+
| `mcp_host` | `string` | `"127.0.0.1"` | Bind host for local networking. |
|
|
438
|
+
| `mcp_port` | `integer` | `9876` | Server listener port. |
|
|
439
|
+
| `daemon_poll_interval_seconds` | `float` | `2.0` | Git state polling frequency. |
|
|
440
|
+
| `shutdown_timeout_seconds` | `float` | `5.0` | Timeout threshold for shutting down. |
|
|
419
441
|
|
|
420
442
|
---
|
|
421
443
|
|
|
422
444
|
## MCP Integration
|
|
423
445
|
|
|
424
446
|
Verify configurations using:
|
|
447
|
+
|
|
425
448
|
```bash
|
|
426
449
|
synap mcp config .
|
|
427
450
|
```
|
|
428
451
|
|
|
429
452
|
### Server Configuration Block
|
|
453
|
+
|
|
430
454
|
```json
|
|
431
455
|
{
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
456
|
+
"mcpServers": {
|
|
457
|
+
"synap": {
|
|
458
|
+
"command": "/usr/local/bin/python",
|
|
459
|
+
"args": ["-m", "synap_git.cli", "start", "/Users/username/repo"]
|
|
460
|
+
}
|
|
436
461
|
}
|
|
437
|
-
}
|
|
438
462
|
}
|
|
439
463
|
```
|
|
440
464
|
|
|
@@ -444,15 +468,15 @@ synap mcp config .
|
|
|
444
468
|
|
|
445
469
|
Synap now processes syntax dynamically for **over 50 programming languages** via `tree-sitter-languages`, including:
|
|
446
470
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
471
|
+
- **Python** (`.py`)
|
|
472
|
+
- **JavaScript / TypeScript** (`.js`, `.jsx`, `.ts`, `.tsx`)
|
|
473
|
+
- **C / C++ / C#** (`.c`, `.cpp`, `.h`, `.hpp`, `.cs`)
|
|
474
|
+
- **Java / Kotlin / Scala** (`.java`, `.kt`, `.kts`, `.scala`)
|
|
475
|
+
- **Go / Rust / Swift** (`.go`, `.rs`, `.swift`)
|
|
476
|
+
- **Ruby / PHP / Perl** (`.rb`, `.php`, `.pl`)
|
|
477
|
+
- **Shell Scripts** (`.sh`, `.bash`, or via `#!` shebang detection)
|
|
478
|
+
- **Data / Config** (`.sql`, `.json`, `.yaml`, `.toml`, `.xml`)
|
|
479
|
+
- **Web** (`.html`, `.css`, `.scss`)
|
|
456
480
|
|
|
457
481
|
Even extensionless scripts are gracefully detected via shebang parsing. Missing grammars automatically degrade gracefully to plaintext indexing.
|
|
458
482
|
|
|
@@ -460,30 +484,32 @@ Even extensionless scripts are gracefully detected via shebang parsing. Missing
|
|
|
460
484
|
|
|
461
485
|
## Supported Providers
|
|
462
486
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
487
|
+
- **Ollama** — Local model integration.
|
|
488
|
+
- **OpenAI** — Cloud GPT models. (Environment Variable: `SYNAP_OPENAI_API_KEY`)
|
|
489
|
+
- **Anthropic** — Cloud Claude models. (Environment Variable: `SYNAP_ANTHROPIC_API_KEY`)
|
|
490
|
+
- **Gemini** — Cloud Gemini models. (Environment Variable: `SYNAP_GEMINI_API_KEY`)
|
|
491
|
+
- **OpenRouter** — Unified cloud model routing. (Environment Variable: `SYNAP_OPENROUTER_API_KEY`)
|
|
468
492
|
|
|
469
493
|
---
|
|
470
494
|
|
|
471
495
|
## Limitations
|
|
472
496
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
497
|
+
- **Git workspace dependency:** Indexes and tracks metadata solely inside valid Git repositories.
|
|
498
|
+
- **Structural-only mode:** Runs without wiki generation or contextual LLM generation if `llm_provider` is unset.
|
|
499
|
+
- **Size exclusions:** Skips binary files and files larger than `max_file_bytes` (default 1MB).
|
|
476
500
|
|
|
477
501
|
---
|
|
478
502
|
|
|
479
503
|
## Contributing
|
|
480
504
|
|
|
481
505
|
Execute unit tests:
|
|
506
|
+
|
|
482
507
|
```bash
|
|
483
508
|
SYNAP_SKIP_STRESS=1 uv run pytest tests/ -x --tb=short
|
|
484
509
|
```
|
|
485
510
|
|
|
486
511
|
Format code and check types:
|
|
512
|
+
|
|
487
513
|
```bash
|
|
488
514
|
uv run ruff format src/
|
|
489
515
|
uv run ruff check src/
|