synap-git 2.1.6__tar.gz → 2.3.0__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.
Files changed (57) hide show
  1. {synap_git-2.1.6 → synap_git-2.3.0}/.gitignore +8 -0
  2. {synap_git-2.1.6 → synap_git-2.3.0}/CHANGELOG.md +79 -5
  3. {synap_git-2.1.6 → synap_git-2.3.0}/PKG-INFO +5 -6
  4. {synap_git-2.1.6 → synap_git-2.3.0}/README.md +3 -5
  5. {synap_git-2.1.6 → synap_git-2.3.0}/pyproject.toml +1 -0
  6. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/__init__.py +1 -1
  7. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/api/app.py +1 -1
  8. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/main.py +149 -94
  9. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/config.py +0 -6
  10. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/diagnostics/logger.py +4 -0
  11. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/git/state.py +1 -1
  12. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/indexer/daemon.py +107 -107
  13. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/indexer/engine.py +89 -59
  14. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/indexer/scanner.py +2 -2
  15. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/indexer/wiki.py +4 -4
  16. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/mcp/server.py +2 -2
  17. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/parser/registry.py +47 -1
  18. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/anthropic.py +6 -5
  19. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/factory.py +4 -3
  20. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/openrouter.py +6 -2
  21. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/retrieval/engine.py +17 -10
  22. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/storage/sqlite.py +38 -1
  23. synap_git-2.3.0/website/README.md +36 -0
  24. synap_git-2.1.6/src/synap_git/cli/mcp.py +0 -137
  25. {synap_git-2.1.6 → synap_git-2.3.0}/.synap.example/README.md +0 -0
  26. {synap_git-2.1.6 → synap_git-2.3.0}/LICENSE.md +0 -0
  27. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/api/__init__.py +0 -0
  28. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/api/static/index.html +0 -0
  29. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/__init__.py +0 -0
  30. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/__main__.py +0 -0
  31. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/checkpoint.py +0 -0
  32. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/lessons.py +0 -0
  33. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/memory.py +0 -0
  34. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/usage.py +0 -0
  35. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/cli/wiki.py +0 -0
  36. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/diagnostics/__init__.py +0 -0
  37. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/diagnostics/tracing.py +0 -0
  38. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/embeddings/__init__.py +0 -0
  39. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/git/__init__.py +0 -0
  40. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/indexer/__init__.py +0 -0
  41. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/mcp/__init__.py +0 -0
  42. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/parser/__init__.py +0 -0
  43. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/__init__.py +0 -0
  44. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/base.py +0 -0
  45. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/gemini.py +0 -0
  46. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/ollama.py +0 -0
  47. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/provider/openai.py +0 -0
  48. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/py.typed +0 -0
  49. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/retrieval/__init__.py +0 -0
  50. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/retrieval/memory.py +0 -0
  51. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/security/__init__.py +0 -0
  52. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/security/redactor.py +0 -0
  53. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/security/sanitizer.py +0 -0
  54. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/security/validator.py +0 -0
  55. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/storage/__init__.py +0 -0
  56. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/utils/__init__.py +0 -0
  57. {synap_git-2.1.6 → synap_git-2.3.0}/src/synap_git/utils/serialization.py +0 -0
@@ -25,3 +25,11 @@ build/
25
25
  .synapse/
26
26
  .synapse/*-wal
27
27
  .synapse/*-shm
28
+ config.json
29
+ status.json
30
+ fix_exc.py
31
+ test_embed.py
32
+ .vscode/
33
+ .idea/
34
+ *.log
35
+ coverage.xml
@@ -5,15 +5,59 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [2.1.5] - 2026-06-11
8
+ ## [2.2.0] - 2026-08-03
9
+
10
+ ## [2.3.0] - 2026-08-03
11
+
12
+ ### Added
13
+ - **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
+ - **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
+
16
+ ### Changed
17
+ - **Frontend Defensive Rendering**: Guarded several UI paths against undefined symbol objects to prevent runtime errors in production (fixed `.type` property reads).
18
+
19
+ ### Chore
20
+ - **Bumped package version** to `2.3.0`.
21
+ - **Release automation**: prepared changelog and release tag for GitHub release `v2.3.0`.
22
+
23
+
24
+ ### Added
25
+
26
+ - **AST Symbol Parser Expansion (AUD-02)**: Implemented Tree-sitter AST symbol extraction handlers for C#, PHP, Kotlin, Scala, and C.
27
+ - **Event-Driven File Watcher (AUD-03)**: Replaced continuous 2s subprocess polling with `watchdog` filesystem event tracking, reducing idle CPU usage to near-zero.
28
+ - **Daemon REST API Diagnostic Checks (AUD-06)**: Added daemon port availability and REST API endpoint status checks to `synap doctor`.
29
+ - **Wiki Task Requeue Subcommand (AUD-08)**: Added `synap wiki retry` CLI subcommand and `retry_failed_wiki_queue` storage method to requeue permanently failed wiki tasks back to pending state.
30
+
31
+ ### Changed
32
+
33
+ - **CLI `synap start` Control Flow (AUD-01)**: Fixed `synap start` so it exits cleanly when a daemon is already running unless `--foreground` is explicitly passed.
34
+ - **SQLite WAL Performance Rationale (AUD-07)**: Documented `PRAGMA synchronous=NORMAL` in WAL mode as an intentional architectural tradeoff balancing write throughput and self-healing index recovery.
35
+
36
+ ### Fixed
37
+
38
+ - **Graceful Embedding Provider Fallback (AUD-04)**: Configured Anthropic and OpenRouter providers to log a warning and return empty embedding vectors instead of raising unhandled `NotImplementedError`.
39
+ - **Symbol Preservation on File Renames (AUD-05)**: Added `-M` rename detection to `git diff-tree` in incremental indexing to preserve file symbol history and edges across renames.
40
+
41
+ ## [2.1.7] - 2026-07-29
42
+
43
+ ### Added
44
+
45
+ - **AI Engineer Rules**: Created standardized agent rulesets across `AGENTS.md`, `.cursorrules`, `.windsurfrules`, and `.github/copilot-instructions.md`.
46
+
47
+ ### Fixed
48
+
49
+ - **Daemon Branch Switching Test Stability**: Resolved timing race condition in daemon branch checkout verification.
50
+ - **CLI Setup Connectivity**: Fixed setup connectivity verification and non-TTY prompt fallback handling.
9
51
 
10
52
  ## [2.1.6] - 2026-06-29
11
53
 
12
54
  ### Added
55
+
13
56
  - **Universal Language Expansion**: Expanded tree-sitter AST parsing support from 4 hardcoded languages to dynamically supporting over ~50 languages using `tree-sitter-languages`. Also added dynamic shebang detection (`#!`) to parse extensionless scripts as python, ruby, node, and bash scripts.
14
57
  - **API Rate Limiting**: Implemented a global `RateLimitedProvider` to throttle LLM and embedding calls to 3 requests per second to mitigate resource exhaustion on the diagnostic API.
15
58
 
16
59
  ### Fixed
60
+
17
61
  - **Broad Exception Handling**: Eradicated remaining `except Exception:` blocks across diagnostics, daemon execution, indexer scanning, and module resolution, and replaced them with `OSError`, `sqlite3.Error`, and specific errors to prevent silent data corruption.
18
62
  - **Async Sleep Compatibility**: Fixed thread-blocking `time.sleep()` in LLM retries by delegating to `anyio.from_thread.run(anyio.sleep)` if invoked inside FastMCP worker threads.
19
63
  - **Edge Resolution & Source Paths**: Added support for resolving Javascript, Java, C++, Ruby, and more during import/edge resolution.
@@ -22,38 +66,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
22
66
  - **Metadata Fixes**: Corrected repository URLs in `pyproject.toml` to correctly point to `synapse` instead of `synap-git`.
23
67
 
24
68
  ### Refactored
69
+
25
70
  - **Daemon Teardown**: Refactored the forceful SIGTERM daemon teardown logic to safely toggle via `force_exit=True` rather than a blanket catch-all. Makes programmatic `daemon.stop()` safer without blocking terminal UI interactions.
26
71
 
27
72
  ## [2.1.4] - 2026-06-11
28
73
 
29
74
  ### Fixed
75
+
30
76
  - **Graceful Shutdown Hang**: Fixed an edge case where `synap stop` would time out and forcefully terminate due to `concurrent.futures` threads preventing immediate python process exit when handling embeddings. The CLI now safely flushes databases and exits instantly.
31
77
 
32
78
  ## [2.1.3] - 2026-06-11
33
79
 
34
80
  ### Changed
81
+
35
82
  - **CLI Interactivity Enhancement**: Wrapped all long-running `synap` CLI commands (`init`, `start`, `stop`, `rollback`, `repair`) with interactive rich status spinners to ensure users never stare at an empty screen.
36
83
  - **Incremental Indexing Progress**: Added a rich progress status to the `_incremental_index` background loop to provide visibility into parsing tasks during cache hits.
37
84
 
38
85
  ## [2.1.2] - 2026-06-11
39
86
 
40
87
  ### Fixed
88
+
41
89
  - **CRITICAL: Daemon Thread Explosion**: Patched a massive concurrency edge case in `SynapRuntime` where large repository indexing would trigger unbounded `threading.Thread` loops for LLM embeddings. A bounded `ThreadPoolExecutor` has been introduced to prevent OOMs, OS thread starvation, and rate-limit hits during first-run indexing.
42
90
  - **Daemon Lifecycle**: Ensure `embedding_executor` shuts down cleanly without leaking background threads when the daemon loop receives SIGTERM.
43
91
 
44
92
  ## [2.1.1] - 2026-06-11
45
93
 
46
94
  ### Fixed
95
+
47
96
  - **CRITICAL: MCP StdIO Stream Corruption**: Fixed a bug where `synap mcp start` and `signal_low_context` would accidentally print progress bars or notifications to `sys.stdout` instead of `sys.stderr`, which corrupted the MCP protocol stream and disconnected IDEs like Cursor/Windsurf.
48
97
  - **UX Improvements**: Improved the silence logic in CLI initialization to prevent unnecessary rich formatting in JSON/MCP environments.
49
98
 
50
99
  ## [2.1.0] - 2026-05-29
51
100
 
52
101
  ### Added
102
+
53
103
  - **CLI `search` command**: New user-facing command for executing hybrid structural searches directly from the terminal.
54
104
  - **`embed_provider` configuration**: Added explicit control over the vector embedding provider via `SYNAP_EMBED_PROVIDER` or `config.toml`.
55
105
 
56
106
  ### Fixed
107
+
57
108
  - **CRITICAL: Metadata Nullability Bug**: Resolved a type mismatch in `CodeSymbol` where `metadata=None` caused background worker crashes. Enforced strict `dict` contract with `default_factory`.
58
109
  - **CRITICAL: Exception Swallowing**: Eradicated 26 instances of silent failure (`except Exception: pass`) across all core subsystems (API, Indexer, Storage, Retrieval, MCP, Providers). Replaced with structured, traceback-aware logging.
59
110
  - **CRITICAL: SQLite Schema Integrity**: Fixed `NOT NULL` constraint failure in `llm_calls` table by aligning schema with insertion logic and adding `cost_usd` support.
@@ -64,10 +115,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
64
115
  ## [2.0.0] - 2026-05-29
65
116
 
66
117
  ### Added
118
+
67
119
  - **.synapignore Support**: Implemented context-aware filtering to prevent traversing symlinks, binary files, and files listed in `.synapignore` or `.gitignore`.
68
120
  - **FTS5 Integration**: Shifted semantic full-text search directly to SQLite FTS5 with bounding limits (`LIMIT 50`) for `O(1)` lexical retrieval scaling on 10,000+ file monorepos.
69
121
 
70
122
  ### Fixed
123
+
71
124
  - **LLM Hangs in Test Suite**: Isolated testing environment by strictly bypassing real LLM provider configs (`SYNAP_LLM_PROVIDER=""`) preventing test CI suite hangs.
72
125
  - **Repository Path Scoping in Hybrid Engine**: Fixed a bug where `repo_path` initialization mistakenly truncated the path to `/tmp` in tests, failing contextual snippet aggregation.
73
126
  - **Unbounded BM25 Expansion**: Bounded full-text search token extraction and BM25 results, preventing out-of-memory cascading in CTE traversal during monorepo indexing.
@@ -75,24 +128,29 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
75
128
  ## [1.2.3] - 2026-05-28
76
129
 
77
130
  ### Added
131
+
78
132
  - **Architecture Documentation Consolidation:** Merged duplicate `docs/architecture.md` into the root-level `ARCHITECTURE.md` to ensure a single, consistent source of architectural truth.
79
133
 
80
134
  ### Fixed
135
+
81
136
  - **Release Version Sync:** Bumped package version in `src/synap_git/__init__.py` to `1.2.3` and updated configuration metadata to align with the release tag validation check in the pipeline.
82
137
 
83
138
  ## [1.1.2] - 2026-05-28
84
139
 
85
140
  ### Added
141
+
86
142
  - **Technical Documentation (`docs/`):** Added detailed manuals for architecture, CLI reference, configuration fields, MCP tools schemas, two-path indexing, wiki queues, and memory lifecycles.
87
143
  - **Main README:** Completely rewrote the `README.md` from scratch to align strictly with the implemented features, CLI commands, configuration options, and integration paths.
88
144
 
89
145
  ### Removed
146
+
90
147
  - **Obsolete Docs:** Purged stale `quickstart.md`, `retrieval.md`, `roadmap.md`, `diagnostics.md`, `performance.md`, `benchmarks.md`, and `security.md` documents.
91
148
  - **Draft Files:** Removed unreferenced root files `SYNAPSE_AUDIT_REPORT.md` and `SYNAPSE_AGENT_PROMPT.md `.
92
149
 
93
150
  ## [1.1.1] - 2026-05-28
94
151
 
95
152
  ### Fixed
153
+
96
154
  - **CRITICAL: N+1 query loop during edge resolution:** Migrated structural edge resolution to bulk FETCH queries, eliminating thousands of database calls per indexing run.
97
155
  - **CRITICAL: SQLite Synchronous Pragma:** Enforced \`PRAGMA synchronous=NORMAL\` on every connection, multiplying write throughput by 10x-100x.
98
156
  - **SPEC: Content-Scoped File IDs:** Updated \`file_id\` formula to \`sha256(path + content_hash)\` ensuring temporal version isolation in the graph.
@@ -103,6 +161,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
103
161
  - **LOW: Checkpoint Validation:** MCP \`create_checkpoint\` tool now validates all input fields to prevent malformed data.
104
162
 
105
163
  ### Added
164
+
106
165
  - **Interactive Review Flow:** New CLI command \`synap lessons review\` for interactive management of agent-proposed lessons.
107
166
  - **Context Monitoring:** New MCP tool \`signal_low_context\` for proactive agent context window monitoring.
108
167
  - **Configurable Maintenance:** Added \`checkpoint_threshold\` and \`lesson_expiry_days\` to \`config.toml\`.
@@ -110,35 +169,40 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
110
169
  - **Onboarding Guidance:** \`synap init\` now provides explicit next steps for starting the system.
111
170
 
112
171
  ### Removed
172
+
113
173
  - **Mock LLM Mode:** \`MockLLMProvider\` removed from the production codebase to maintain strict operational integrity.
114
174
 
115
175
  ## [1.1.0] - 2026-05-28
116
176
 
117
177
  ### Added — Git-Snapshot Projection & Performance Refactoring
178
+
118
179
  - **Split Two-Path Indexing:** Separated initialization and incremental indexing into `_first_run_index` (full scan, CPU-parallelized) and `_incremental_index` (Git delta change detector).
119
180
  - **Asynchronous Wiki Generation Queue:** Decoupled slow, non-deterministic LLM wiki generation from structural indexing using a persistent database queue (`wiki_queue`) processed asynchronously by a daemon worker.
120
181
  - **Lazy Wiki Caching:** Added synchronous wiki generation fallback to CLI (`wiki show`), Web API, and MCP tools to dynamically build missing or stale pages on-demand.
121
182
  - **Process Pool Parallel Parsing:** Parallelized Tree-sitter parsing on first run across all CPU cores utilizing process-based concurrency with independent parser instances.
122
183
  - **SQLite Performance Hardening:**
123
- - WAL mode and NORMAL synchronous configuration enabled during writes.
124
- - Multi-row symbol and edge inserts batched into a single transaction via `executemany`.
125
- - Dot-separated `module_key` pre-computation and indexing for $O(1)$ module resolution.
126
- - SQLite FTS5 index integration for fast sub-millisecond symbol searches, avoiding full-table scans.
184
+ - WAL mode and NORMAL synchronous configuration enabled during writes.
185
+ - Multi-row symbol and edge inserts batched into a single transaction via `executemany`.
186
+ - Dot-separated `module_key` pre-computation and indexing for $O(1)$ module resolution.
187
+ - SQLite FTS5 index integration for fast sub-millisecond symbol searches, avoiding full-table scans.
127
188
  - **Web API Lazy Refreshes:** Updated the `/wiki/{filepath}` GET endpoint to perform lazy refreshes on stale or missing pages before returning content.
128
189
 
129
190
  ### Fixed
191
+
130
192
  - **FTS5 Cascade Delete:** Added database trigger `tgr_symbols_delete` to automatically clean up virtual `symbols_fts` entries when parent symbols are deleted.
131
193
  - **Duplicate File ID Collision:** Handled unique, path-scoped file identifier generation ensuring files with identical content (like empty `__init__.py`) do not conflict.
132
194
 
133
195
  ## [0.2.1] - 2026-05-27
134
196
 
135
197
  ### Added — Final Production Hardening & Release Execution
198
+
136
199
  - `synap rollback --commit <ref>` option: directly target a commit by hash/reference without interactive selection prompt.
137
200
  - `synap rollback --yes` / `-y` option: suppress confirmation prompt for non-interactive and scripted rollback flows.
138
201
  - Non-interactive guard in `synap rollback`: fails fast with a clear error when used in piped/CI contexts without `--commit` or `--yes`.
139
202
  - `synap rollback` invalid commit detection: validates commit reference via `git rev-parse --verify` and rejects unknown refs with a clear message.
140
203
 
141
204
  ### Fixed
205
+
142
206
  - **SQLite migration short-circuit bug**: legacy un-versioned databases (user_version = 0) incorrectly skipped `CREATE TABLE IF NOT EXISTS` execution, leaving the `symbols` table and others uninitialized. The premature short-circuit is removed; all schema tables are now created correctly before bumping to version 1.
143
207
  - **Python `import_from_statement` missing symbol extraction**: Tree-sitter AST parser only extracted the module identifier from `from X import Y` statements, discarding `Y`. Now correctly emits `module:symbol` pairs for all imported names, aliases, and grouped imports.
144
208
  - **Namespace-aware call edge resolution**: Pass 2 import resolver now splits `module:symbol` import entries to narrow edge targets to the correct module file, eliminating false-positive dependency edges to duplicate class names in sibling namespaces.
@@ -147,11 +211,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
147
211
  - **Degraded mode retry logic**: confirmed 2-stage exponential backoff and graceful structural fallback under fully-offline and timeout conditions.
148
212
 
149
213
  ### Changed
214
+
150
215
  - Daemon resilience test (`test_daemon_resilience.py`) hardened against race condition where `SIGKILL` test read a stale PID from a prior run that had already exited.
151
216
 
152
217
  ## [0.2.0] - 2026-05-26
153
218
 
154
219
  ### Added — Final Polish & Release Readiness
220
+
155
221
  - CLI usage management: `synap usage show` (displays Rich aggregated usage table and summary panel) and `synap usage clear`.
156
222
  - CLI wiki management: `synap wiki list` and `synap wiki show <filepath>` (renders page in terminal via Rich Markdown).
157
223
  - LLM call database logging: records `prompt_tokens`, `completion_tokens` for retrieval and wiki generation passes.
@@ -161,6 +227,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
161
227
  - Clean Typer execution wrapper: intercepts configuration and credential exceptions to output actionable suggestions (e.g. `synap setup`) instead of tracebacks.
162
228
 
163
229
  ### Added — Hardening Loop 2: MCP Stability & Protocol Polish
230
+
164
231
  - Deterministic MCP JSON envelope: every tool response carries `ok`, `data`, `warnings`, `trace_id`, `dirty_tree`.
165
232
  - Structured error objects with `code`, `message`, and `suggestion` fields for all failure paths.
166
233
  - `dirty_tree` propagation: agents are warned when the working tree is ahead of the index.
@@ -168,6 +235,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
168
235
  - `synap mcp verify` command to assert full protocol contract compliance.
169
236
 
170
237
  ### Added — Hardening Loop 3: Lesson System Trust & Memory Lifecycle
238
+
171
239
  - Formal `LessonStatus` enum enforcing explicit state machine: `PENDING → APPROVED/REJECTED`, `APPROVED → EXPIRED`.
172
240
  - Retrieval gating: only `APPROVED`, non-expired lessons are injected into LLM context as `# APPROVED SYSTEM MEMORY`.
173
241
  - `prune_expired_lessons()` transitions stale lessons to `EXPIRED` state on demand.
@@ -178,6 +246,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
178
246
  - `synap lessons approve <id>` and `synap lessons reject <id>` — explicit human governance over pending lessons.
179
247
 
180
248
  ### Added — Hardening Loop 4: Tracing, Git Compliance & Release Hardening
249
+
181
250
  - `GitIgnoreSpec` glob-to-regex parser in `RepositoryScanner` respects `.gitignore` patterns.
182
251
  - Auto-protection: `SynapRuntime.bootstrap()` automatically adds `.synap/` to `.gitignore`.
183
252
  - Enhanced binary file detection via extension blocklist + control-character ratio analysis.
@@ -193,18 +262,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
193
262
  - `py.typed` marker for PEP 561 compliance.
194
263
 
195
264
  ### Changed
265
+
196
266
  - CI pipeline split into 4 focused jobs: `lint`, `test`, `benchmark` (main only), `release-validation`.
197
267
  - Release validation now runs `synap init` before `synap doctor` to ensure a valid Synap DB context.
198
268
  - `pytest` configured with `asyncio_default_fixture_loop_scope = "function"` to eliminate deprecation warnings.
199
269
  - Benchmark tests gated behind `benchmark` marker; skipped in fast PR CI passes.
200
270
 
201
271
  ### Fixed
272
+
202
273
  - `synap doctor` in CI release validation step previously ran against an uninitialized directory.
203
274
  - `ruff format` drift in `cli/main.py` and `indexer/daemon.py` resolved.
204
275
 
205
276
  ## [0.1.0] - 2026-05-25
206
277
 
207
278
  ### Added
279
+
208
280
  - Core deterministic indexing engine using Tree-sitter and Git content hashes.
209
281
  - 4-stage hybrid retrieval pipeline (Temporal, Structural, Lexical, Semantic).
210
282
  - Model Context Protocol (MCP) server for IDE integration.
@@ -214,11 +286,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
214
286
  - Diagnostic UI dashboard.
215
287
 
216
288
  ### Changed
289
+
217
290
  - Refactored entire architecture from event-sourcing to deterministic Git projections.
218
291
  - Consolidated storage into unified SQLite schema with Recursive CTE support.
219
292
  - Upgraded documentation to production infrastructure standards.
220
293
 
221
294
  ### Removed
295
+
222
296
  - Legacy "cognitive OS" and "graph operating system" abstractions.
223
297
  - Speculative async priority queues and replay engines.
224
298
  - Brittle regex-based parsers.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: synap-git
3
- Version: 2.1.6
3
+ Version: 2.3.0
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
@@ -37,6 +37,7 @@ Requires-Dist: tree-sitter-languages==1.10.2
37
37
  Requires-Dist: tree-sitter==0.20.4
38
38
  Requires-Dist: typer==0.15.1
39
39
  Requires-Dist: uvicorn==0.34.0
40
+ Requires-Dist: watchdog>=6.0.0
40
41
  Provides-Extra: dev
41
42
  Requires-Dist: bandit==1.8.3; extra == 'dev'
42
43
  Requires-Dist: mypy==1.15.0; extra == 'dev'
@@ -339,8 +340,8 @@ Initialize the local SQLite database index:
339
340
  synap init .
340
341
  ```
341
342
 
342
- ### 3. Detach Watcher Daemon
343
- Start background monitoring:
343
+ ### 3. Connect IDE / Start MCP
344
+ Launch the unified background daemon and MCP stdio server:
344
345
  ```bash
345
346
  synap start .
346
347
  ```
@@ -372,7 +373,6 @@ All commands support target path arguments:
372
373
  * `synap doctor [PATH]` — Verifies database integrity and parsers.
373
374
  * `synap run [PATH]` — Runs daemon in foreground.
374
375
  * `synap ui [PATH]` — Launches HTML dashboard.
375
- * `synap mcp start [PATH]` — Hosts MCP stdio server.
376
376
  * `synap mcp config [PATH]` — Outputs Cursor connection blocks.
377
377
  * `synap mcp verify [PATH]` — Asserts MCP server stability.
378
378
  * `synap memory status [PATH]` — Lists lesson counts.
@@ -432,8 +432,7 @@ synap mcp config .
432
432
  "mcpServers": {
433
433
  "synap": {
434
434
  "command": "/usr/local/bin/python",
435
- "args": ["-m", "synap_git.cli", "mcp", "start", "/Users/username/repo"],
436
- "autoConnect": true
435
+ "args": ["-m", "synap_git.cli", "start", "/Users/username/repo"]
437
436
  }
438
437
  }
439
438
  }
@@ -289,8 +289,8 @@ Initialize the local SQLite database index:
289
289
  synap init .
290
290
  ```
291
291
 
292
- ### 3. Detach Watcher Daemon
293
- Start background monitoring:
292
+ ### 3. Connect IDE / Start MCP
293
+ Launch the unified background daemon and MCP stdio server:
294
294
  ```bash
295
295
  synap start .
296
296
  ```
@@ -322,7 +322,6 @@ All commands support target path arguments:
322
322
  * `synap doctor [PATH]` — Verifies database integrity and parsers.
323
323
  * `synap run [PATH]` — Runs daemon in foreground.
324
324
  * `synap ui [PATH]` — Launches HTML dashboard.
325
- * `synap mcp start [PATH]` — Hosts MCP stdio server.
326
325
  * `synap mcp config [PATH]` — Outputs Cursor connection blocks.
327
326
  * `synap mcp verify [PATH]` — Asserts MCP server stability.
328
327
  * `synap memory status [PATH]` — Lists lesson counts.
@@ -382,8 +381,7 @@ synap mcp config .
382
381
  "mcpServers": {
383
382
  "synap": {
384
383
  "command": "/usr/local/bin/python",
385
- "args": ["-m", "synap_git.cli", "mcp", "start", "/Users/username/repo"],
386
- "autoConnect": true
384
+ "args": ["-m", "synap_git.cli", "start", "/Users/username/repo"]
387
385
  }
388
386
  }
389
387
  }
@@ -37,6 +37,7 @@ dependencies = [
37
37
  "tree-sitter-languages==1.10.2",
38
38
  "typer==0.15.1",
39
39
  "uvicorn==0.34.0",
40
+ "watchdog>=6.0.0",
40
41
  ]
41
42
 
42
43
  [project.urls]
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "2.1.6"
5
+ __version__ = "2.3.0"
@@ -104,7 +104,7 @@ def create_app(runtime: SynapRuntime) -> FastAPI:
104
104
  except Exception as e:
105
105
  import structlog
106
106
 
107
- structlog.get_logger().error("suppressed_error_caught", exc_info=True)
107
+ structlog.get_logger().error("suppressed_error_caught", error=str(e))
108
108
 
109
109
  wiki_path = runtime.wiki.wiki_dir / f"{target}.md"
110
110
  exists = await asyncio.to_thread(wiki_path.exists)