sovyx 0.1.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 (182) hide show
  1. sovyx-0.1.0/.dockerignore +16 -0
  2. sovyx-0.1.0/.github/workflows/ci.yml +84 -0
  3. sovyx-0.1.0/.github/workflows/docker.yml +51 -0
  4. sovyx-0.1.0/.github/workflows/publish.yml +27 -0
  5. sovyx-0.1.0/.gitignore +59 -0
  6. sovyx-0.1.0/.pre-commit-config.yaml +20 -0
  7. sovyx-0.1.0/CHANGELOG.md +48 -0
  8. sovyx-0.1.0/CONTRIBUTING.md +85 -0
  9. sovyx-0.1.0/COVERAGE.md +19 -0
  10. sovyx-0.1.0/Dockerfile +50 -0
  11. sovyx-0.1.0/LICENSE +661 -0
  12. sovyx-0.1.0/Makefile +29 -0
  13. sovyx-0.1.0/PKG-INFO +197 -0
  14. sovyx-0.1.0/README.md +153 -0
  15. sovyx-0.1.0/benchmarks/__init__.py +1 -0
  16. sovyx-0.1.0/benchmarks/bench_brain.py +119 -0
  17. sovyx-0.1.0/benchmarks/bench_cogloop.py +120 -0
  18. sovyx-0.1.0/docker-compose.yml +23 -0
  19. sovyx-0.1.0/docs/architecture.md +99 -0
  20. sovyx-0.1.0/docs/configuration.md +66 -0
  21. sovyx-0.1.0/docs/quickstart.md +70 -0
  22. sovyx-0.1.0/pyproject.toml +104 -0
  23. sovyx-0.1.0/scripts/check.sh +27 -0
  24. sovyx-0.1.0/scripts/install.sh +43 -0
  25. sovyx-0.1.0/sovyx.service +24 -0
  26. sovyx-0.1.0/src/sovyx/__init__.py +6 -0
  27. sovyx-0.1.0/src/sovyx/__main__.py +12 -0
  28. sovyx-0.1.0/src/sovyx/brain/__init__.py +1 -0
  29. sovyx-0.1.0/src/sovyx/brain/concept_repo.py +292 -0
  30. sovyx-0.1.0/src/sovyx/brain/consolidation.py +150 -0
  31. sovyx-0.1.0/src/sovyx/brain/embedding.py +349 -0
  32. sovyx-0.1.0/src/sovyx/brain/episode_repo.py +209 -0
  33. sovyx-0.1.0/src/sovyx/brain/learning.py +203 -0
  34. sovyx-0.1.0/src/sovyx/brain/models.py +84 -0
  35. sovyx-0.1.0/src/sovyx/brain/relation_repo.py +271 -0
  36. sovyx-0.1.0/src/sovyx/brain/retrieval.py +182 -0
  37. sovyx-0.1.0/src/sovyx/brain/service.py +288 -0
  38. sovyx-0.1.0/src/sovyx/brain/spreading.py +128 -0
  39. sovyx-0.1.0/src/sovyx/brain/working_memory.py +104 -0
  40. sovyx-0.1.0/src/sovyx/bridge/__init__.py +1 -0
  41. sovyx-0.1.0/src/sovyx/bridge/channels/__init__.py +1 -0
  42. sovyx-0.1.0/src/sovyx/bridge/channels/telegram.py +178 -0
  43. sovyx-0.1.0/src/sovyx/bridge/identity.py +111 -0
  44. sovyx-0.1.0/src/sovyx/bridge/manager.py +268 -0
  45. sovyx-0.1.0/src/sovyx/bridge/protocol.py +55 -0
  46. sovyx-0.1.0/src/sovyx/bridge/sessions.py +171 -0
  47. sovyx-0.1.0/src/sovyx/cli/__init__.py +1 -0
  48. sovyx-0.1.0/src/sovyx/cli/commands/__init__.py +1 -0
  49. sovyx-0.1.0/src/sovyx/cli/main.py +295 -0
  50. sovyx-0.1.0/src/sovyx/cli/rpc_client.py +103 -0
  51. sovyx-0.1.0/src/sovyx/cognitive/__init__.py +1 -0
  52. sovyx-0.1.0/src/sovyx/cognitive/act.py +122 -0
  53. sovyx-0.1.0/src/sovyx/cognitive/attend.py +90 -0
  54. sovyx-0.1.0/src/sovyx/cognitive/gate.py +135 -0
  55. sovyx-0.1.0/src/sovyx/cognitive/loop.py +155 -0
  56. sovyx-0.1.0/src/sovyx/cognitive/perceive.py +155 -0
  57. sovyx-0.1.0/src/sovyx/cognitive/reflect.py +139 -0
  58. sovyx-0.1.0/src/sovyx/cognitive/state.py +77 -0
  59. sovyx-0.1.0/src/sovyx/cognitive/think.py +114 -0
  60. sovyx-0.1.0/src/sovyx/context/__init__.py +1 -0
  61. sovyx-0.1.0/src/sovyx/context/assembler.py +203 -0
  62. sovyx-0.1.0/src/sovyx/context/budget.py +156 -0
  63. sovyx-0.1.0/src/sovyx/context/formatter.py +184 -0
  64. sovyx-0.1.0/src/sovyx/context/tokenizer.py +108 -0
  65. sovyx-0.1.0/src/sovyx/engine/__init__.py +1 -0
  66. sovyx-0.1.0/src/sovyx/engine/bootstrap.py +316 -0
  67. sovyx-0.1.0/src/sovyx/engine/config.py +194 -0
  68. sovyx-0.1.0/src/sovyx/engine/degradation.py +170 -0
  69. sovyx-0.1.0/src/sovyx/engine/errors.py +236 -0
  70. sovyx-0.1.0/src/sovyx/engine/events.py +296 -0
  71. sovyx-0.1.0/src/sovyx/engine/health.py +255 -0
  72. sovyx-0.1.0/src/sovyx/engine/lifecycle.py +269 -0
  73. sovyx-0.1.0/src/sovyx/engine/protocols.py +184 -0
  74. sovyx-0.1.0/src/sovyx/engine/registry.py +139 -0
  75. sovyx-0.1.0/src/sovyx/engine/rpc_protocol.py +75 -0
  76. sovyx-0.1.0/src/sovyx/engine/rpc_server.py +119 -0
  77. sovyx-0.1.0/src/sovyx/engine/types.py +99 -0
  78. sovyx-0.1.0/src/sovyx/llm/__init__.py +1 -0
  79. sovyx-0.1.0/src/sovyx/llm/circuit.py +65 -0
  80. sovyx-0.1.0/src/sovyx/llm/cost.py +193 -0
  81. sovyx-0.1.0/src/sovyx/llm/models.py +39 -0
  82. sovyx-0.1.0/src/sovyx/llm/providers/__init__.py +0 -0
  83. sovyx-0.1.0/src/sovyx/llm/providers/_shared.py +92 -0
  84. sovyx-0.1.0/src/sovyx/llm/providers/anthropic.py +189 -0
  85. sovyx-0.1.0/src/sovyx/llm/providers/ollama.py +155 -0
  86. sovyx-0.1.0/src/sovyx/llm/providers/openai.py +170 -0
  87. sovyx-0.1.0/src/sovyx/llm/router.py +200 -0
  88. sovyx-0.1.0/src/sovyx/mind/__init__.py +1 -0
  89. sovyx-0.1.0/src/sovyx/mind/config.py +206 -0
  90. sovyx-0.1.0/src/sovyx/mind/personality.py +200 -0
  91. sovyx-0.1.0/src/sovyx/observability/__init__.py +1 -0
  92. sovyx-0.1.0/src/sovyx/observability/logging.py +162 -0
  93. sovyx-0.1.0/src/sovyx/persistence/__init__.py +1 -0
  94. sovyx-0.1.0/src/sovyx/persistence/datetime_utils.py +55 -0
  95. sovyx-0.1.0/src/sovyx/persistence/manager.py +193 -0
  96. sovyx-0.1.0/src/sovyx/persistence/migrations.py +277 -0
  97. sovyx-0.1.0/src/sovyx/persistence/pool.py +273 -0
  98. sovyx-0.1.0/src/sovyx/persistence/schemas/__init__.py +1 -0
  99. sovyx-0.1.0/src/sovyx/persistence/schemas/brain.py +161 -0
  100. sovyx-0.1.0/src/sovyx/persistence/schemas/conversations.py +75 -0
  101. sovyx-0.1.0/src/sovyx/persistence/schemas/system.py +55 -0
  102. sovyx-0.1.0/src/sovyx/py.typed +0 -0
  103. sovyx-0.1.0/tests/__init__.py +1 -0
  104. sovyx-0.1.0/tests/conftest.py +26 -0
  105. sovyx-0.1.0/tests/integration/__init__.py +1 -0
  106. sovyx-0.1.0/tests/integration/test_brain_roundtrip.py +162 -0
  107. sovyx-0.1.0/tests/integration/test_cognitive_pipeline.py +191 -0
  108. sovyx-0.1.0/tests/unit/__init__.py +1 -0
  109. sovyx-0.1.0/tests/unit/brain/__init__.py +1 -0
  110. sovyx-0.1.0/tests/unit/brain/test_concept_repo.py +361 -0
  111. sovyx-0.1.0/tests/unit/brain/test_consolidation.py +202 -0
  112. sovyx-0.1.0/tests/unit/brain/test_embedding.py +444 -0
  113. sovyx-0.1.0/tests/unit/brain/test_episode_repo.py +294 -0
  114. sovyx-0.1.0/tests/unit/brain/test_learning.py +338 -0
  115. sovyx-0.1.0/tests/unit/brain/test_models.py +90 -0
  116. sovyx-0.1.0/tests/unit/brain/test_relation_repo.py +206 -0
  117. sovyx-0.1.0/tests/unit/brain/test_retrieval.py +246 -0
  118. sovyx-0.1.0/tests/unit/brain/test_service.py +375 -0
  119. sovyx-0.1.0/tests/unit/brain/test_spreading.py +277 -0
  120. sovyx-0.1.0/tests/unit/brain/test_working_memory.py +148 -0
  121. sovyx-0.1.0/tests/unit/bridge/__init__.py +0 -0
  122. sovyx-0.1.0/tests/unit/bridge/test_identity.py +120 -0
  123. sovyx-0.1.0/tests/unit/bridge/test_manager.py +337 -0
  124. sovyx-0.1.0/tests/unit/bridge/test_protocol.py +67 -0
  125. sovyx-0.1.0/tests/unit/bridge/test_sessions.py +173 -0
  126. sovyx-0.1.0/tests/unit/bridge/test_telegram.py +261 -0
  127. sovyx-0.1.0/tests/unit/cli/__init__.py +1 -0
  128. sovyx-0.1.0/tests/unit/cli/test_main.py +195 -0
  129. sovyx-0.1.0/tests/unit/cognitive/__init__.py +0 -0
  130. sovyx-0.1.0/tests/unit/cognitive/test_act.py +100 -0
  131. sovyx-0.1.0/tests/unit/cognitive/test_attend.py +62 -0
  132. sovyx-0.1.0/tests/unit/cognitive/test_gate.py +162 -0
  133. sovyx-0.1.0/tests/unit/cognitive/test_loop.py +197 -0
  134. sovyx-0.1.0/tests/unit/cognitive/test_perceive.py +100 -0
  135. sovyx-0.1.0/tests/unit/cognitive/test_reflect.py +145 -0
  136. sovyx-0.1.0/tests/unit/cognitive/test_state.py +200 -0
  137. sovyx-0.1.0/tests/unit/cognitive/test_think.py +129 -0
  138. sovyx-0.1.0/tests/unit/context/__init__.py +0 -0
  139. sovyx-0.1.0/tests/unit/context/test_assembler.py +274 -0
  140. sovyx-0.1.0/tests/unit/context/test_budget.py +137 -0
  141. sovyx-0.1.0/tests/unit/context/test_formatter.py +222 -0
  142. sovyx-0.1.0/tests/unit/context/test_tokenizer.py +171 -0
  143. sovyx-0.1.0/tests/unit/engine/__init__.py +1 -0
  144. sovyx-0.1.0/tests/unit/engine/test_bootstrap.py +159 -0
  145. sovyx-0.1.0/tests/unit/engine/test_config.py +253 -0
  146. sovyx-0.1.0/tests/unit/engine/test_degradation.py +139 -0
  147. sovyx-0.1.0/tests/unit/engine/test_errors.py +296 -0
  148. sovyx-0.1.0/tests/unit/engine/test_events.py +276 -0
  149. sovyx-0.1.0/tests/unit/engine/test_health.py +263 -0
  150. sovyx-0.1.0/tests/unit/engine/test_lifecycle.py +198 -0
  151. sovyx-0.1.0/tests/unit/engine/test_protocols.py +285 -0
  152. sovyx-0.1.0/tests/unit/engine/test_registry.py +162 -0
  153. sovyx-0.1.0/tests/unit/engine/test_rpc.py +172 -0
  154. sovyx-0.1.0/tests/unit/engine/test_rpc_protocol.py +94 -0
  155. sovyx-0.1.0/tests/unit/engine/test_types.py +156 -0
  156. sovyx-0.1.0/tests/unit/llm/__init__.py +0 -0
  157. sovyx-0.1.0/tests/unit/llm/test_circuit.py +102 -0
  158. sovyx-0.1.0/tests/unit/llm/test_cost.py +153 -0
  159. sovyx-0.1.0/tests/unit/llm/test_models.py +47 -0
  160. sovyx-0.1.0/tests/unit/llm/test_providers.py +337 -0
  161. sovyx-0.1.0/tests/unit/llm/test_router.py +206 -0
  162. sovyx-0.1.0/tests/unit/llm/test_shared_utils.py +140 -0
  163. sovyx-0.1.0/tests/unit/mind/__init__.py +0 -0
  164. sovyx-0.1.0/tests/unit/mind/test_config.py +281 -0
  165. sovyx-0.1.0/tests/unit/mind/test_personality.py +228 -0
  166. sovyx-0.1.0/tests/unit/observability/__init__.py +1 -0
  167. sovyx-0.1.0/tests/unit/observability/test_logging.py +201 -0
  168. sovyx-0.1.0/tests/unit/persistence/__init__.py +1 -0
  169. sovyx-0.1.0/tests/unit/persistence/test_brain_schema.py +248 -0
  170. sovyx-0.1.0/tests/unit/persistence/test_conversation_schema.py +170 -0
  171. sovyx-0.1.0/tests/unit/persistence/test_datetime_utils.py +61 -0
  172. sovyx-0.1.0/tests/unit/persistence/test_manager.py +158 -0
  173. sovyx-0.1.0/tests/unit/persistence/test_migrations.py +349 -0
  174. sovyx-0.1.0/tests/unit/persistence/test_pool.py +394 -0
  175. sovyx-0.1.0/tests/unit/persistence/test_system_schema.py +138 -0
  176. sovyx-0.1.0/tests/unit/test_benchmarks.py +66 -0
  177. sovyx-0.1.0/tests/unit/test_brain_properties.py +112 -0
  178. sovyx-0.1.0/tests/unit/test_cogloop_properties.py +105 -0
  179. sovyx-0.1.0/tests/unit/test_edge_cases.py +112 -0
  180. sovyx-0.1.0/tests/unit/test_init.py +119 -0
  181. sovyx-0.1.0/tests/unit/test_packaging.py +48 -0
  182. sovyx-0.1.0/uv.lock +2113 -0
@@ -0,0 +1,16 @@
1
+ .git
2
+ .github
3
+ .venv
4
+ __pycache__
5
+ *.pyc
6
+ .pytest_cache
7
+ .hypothesis
8
+ .mypy_cache
9
+ .ruff_cache
10
+ .coverage
11
+ htmlcov
12
+ tests
13
+ benchmarks
14
+ docs
15
+ *.md
16
+ !README.md
@@ -0,0 +1,84 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ jobs:
14
+ lint:
15
+ name: Lint (ruff)
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: astral-sh/setup-uv@v5
20
+ with:
21
+ version: "latest"
22
+ - name: Install dependencies
23
+ run: uv sync --dev
24
+ - name: Ruff check
25
+ run: uv run ruff check src/ tests/
26
+ - name: Ruff format check
27
+ run: uv run ruff format --check src/ tests/
28
+
29
+ typecheck:
30
+ name: Type Check (mypy)
31
+ runs-on: ubuntu-latest
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - uses: astral-sh/setup-uv@v5
35
+ with:
36
+ version: "latest"
37
+ - name: Install dependencies
38
+ run: uv sync --dev
39
+ - name: mypy strict
40
+ run: uv run mypy src/
41
+
42
+ security:
43
+ name: Security (bandit)
44
+ runs-on: ubuntu-latest
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - uses: astral-sh/setup-uv@v5
48
+ with:
49
+ version: "latest"
50
+ - name: Install dependencies
51
+ run: uv sync --dev
52
+ - name: Bandit scan
53
+ run: uv run bandit -r src/sovyx/ --configfile pyproject.toml
54
+
55
+ test:
56
+ name: Test (Python ${{ matrix.python-version }})
57
+ runs-on: ubuntu-latest
58
+ strategy:
59
+ fail-fast: true
60
+ matrix:
61
+ python-version: ["3.11", "3.12"]
62
+ steps:
63
+ - uses: actions/checkout@v4
64
+ - uses: astral-sh/setup-uv@v5
65
+ with:
66
+ version: "latest"
67
+ - name: Set Python version
68
+ run: uv python install ${{ matrix.python-version }}
69
+ - name: Install dependencies
70
+ run: uv sync --dev --python ${{ matrix.python-version }}
71
+ - name: Run tests with coverage
72
+ run: >
73
+ uv run python -m pytest tests/
74
+ --cov=sovyx
75
+ --cov-report=term-missing
76
+ --cov-report=xml:coverage.xml
77
+ --cov-fail-under=95
78
+ -v
79
+ - name: Upload coverage
80
+ if: matrix.python-version == '3.12'
81
+ uses: actions/upload-artifact@v4
82
+ with:
83
+ name: coverage-report
84
+ path: coverage.xml
@@ -0,0 +1,51 @@
1
+ name: Docker
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build:
10
+ name: Build & Push
11
+ runs-on: ubuntu-latest
12
+ permissions:
13
+ contents: read
14
+ packages: write
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up QEMU (multi-arch)
20
+ uses: docker/setup-qemu-action@v3
21
+
22
+ - name: Set up Docker Buildx
23
+ uses: docker/setup-buildx-action@v3
24
+
25
+ - name: Login to GHCR
26
+ uses: docker/login-action@v3
27
+ with:
28
+ registry: ghcr.io
29
+ username: ${{ github.actor }}
30
+ password: ${{ secrets.GITHUB_TOKEN }}
31
+
32
+ - name: Extract version
33
+ id: meta
34
+ uses: docker/metadata-action@v5
35
+ with:
36
+ images: ghcr.io/sovyx-ai/sovyx
37
+ tags: |
38
+ type=semver,pattern={{version}}
39
+ type=semver,pattern={{major}}.{{minor}}
40
+ type=raw,value=latest,enable={{is_default_branch}}
41
+
42
+ - name: Build and push
43
+ uses: docker/build-push-action@v6
44
+ with:
45
+ context: .
46
+ platforms: linux/amd64,linux/arm64
47
+ push: true
48
+ tags: ${{ steps.meta.outputs.tags }}
49
+ labels: ${{ steps.meta.outputs.labels }}
50
+ cache-from: type=gha
51
+ cache-to: type=gha,mode=max
@@ -0,0 +1,27 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ publish:
10
+ name: Build & Publish
11
+ runs-on: ubuntu-latest
12
+ environment: pypi
13
+ permissions:
14
+ id-token: write # trusted publisher (no API key needed)
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - uses: astral-sh/setup-uv@v5
20
+ with:
21
+ version: "latest"
22
+
23
+ - name: Build
24
+ run: uv build
25
+
26
+ - name: Publish to PyPI
27
+ uses: pypa/gh-action-pypi-publish@release/v1
sovyx-0.1.0/.gitignore ADDED
@@ -0,0 +1,59 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+
7
+ # Virtual environments
8
+ .venv/
9
+ venv/
10
+ ENV/
11
+
12
+ # Distribution
13
+ dist/
14
+ build/
15
+ *.egg-info/
16
+ *.egg
17
+
18
+ # IDE
19
+ .idea/
20
+ .vscode/
21
+ *.swp
22
+ *.swo
23
+ *~
24
+
25
+ # Environment
26
+ .env
27
+ .env.*
28
+
29
+ # Databases
30
+ *.db
31
+ *.db-wal
32
+ *.db-shm
33
+
34
+ # Coverage
35
+ htmlcov/
36
+ .coverage
37
+ .coverage.*
38
+ coverage.xml
39
+
40
+ # mypy
41
+ .mypy_cache/
42
+
43
+ # ruff
44
+ .ruff_cache/
45
+
46
+ # pytest
47
+ .pytest_cache/
48
+
49
+ # OS
50
+ .DS_Store
51
+ Thumbs.db
52
+
53
+ # Models (large binaries)
54
+ *.onnx
55
+ *.bin
56
+
57
+ # Sovyx data (local)
58
+ .sovyx/
59
+ .hypothesis/
@@ -0,0 +1,20 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.3.0
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/pre-commit/mirrors-mypy
10
+ rev: v1.9.0
11
+ hooks:
12
+ - id: mypy
13
+ additional_dependencies:
14
+ - pydantic>=2.6
15
+ - pydantic-settings>=2.2
16
+ - typer>=0.12
17
+ - structlog>=24.1
18
+ args: [--strict]
19
+ pass_filenames: false
20
+ entry: mypy src/
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to Sovyx will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.0] — 2026-04-03
9
+
10
+ ### Added
11
+ - **Cognitive Loop**: Full perception → attention → thinking → action → reflection pipeline
12
+ - **Brain System**: Concept/episode/relation storage with SQLite + sqlite-vec embeddings
13
+ - **Working Memory**: Activation-based with geometric decay
14
+ - **Spreading Activation**: Multi-hop concept retrieval
15
+ - **Hebbian Learning**: Strengthen connections between co-occurring concepts
16
+ - **Ebbinghaus Decay**: Forgetting curve with rehearsal factor
17
+ - **Hybrid Retrieval**: RRF fusion of FTS5 + vector search
18
+ - **Memory Consolidation**: Scheduled decay + pruning cycles
19
+ - **Personality Engine**: OCEAN model with 3-level descriptors
20
+ - **Context Assembly**: Token-budget-aware with Lost-in-Middle ordering (Liu et al. 2023)
21
+ - **LLM Router**: Multi-provider failover (Anthropic, OpenAI, Ollama) with circuit breaker
22
+ - **Cost Guard**: Per-conversation and daily budget limits
23
+ - **Telegram Channel**: aiogram 3.x with exponential backoff reconnect
24
+ - **Person Resolver**: Auto-create identity on first contact
25
+ - **Conversation Tracker**: 30min timeout, 50-turn history
26
+ - **CLI**: `sovyx init/start/stop/status/doctor/brain/mind` commands (typer + rich)
27
+ - **Daemon**: JSON-RPC 2.0 over Unix socket (0o600 permissions)
28
+ - **Lifecycle Manager**: PID lock, SIGTERM/SIGINT graceful shutdown, sd_notify
29
+ - **Health Checker**: 10 concurrent checks (sqlite, brain, LLM, disk, memory)
30
+ - **Graceful Degradation**: Fallback chains for each component
31
+ - **Service Registry**: Lightweight DI with singleton factories
32
+ - **Event Bus**: Typed pub/sub for system events
33
+ - **Structured Logging**: structlog with JSON output
34
+ - **Docker**: Multi-stage build, non-root user, healthcheck
35
+ - **systemd**: Unit file with security hardening
36
+ - **Installer**: One-liner shell script via uv
37
+
38
+ ### Technical
39
+ - 1138 tests (1130 passed, 8 skipped)
40
+ - 95%+ code coverage
41
+ - mypy strict mode (zero errors)
42
+ - ruff lint + format (zero warnings)
43
+ - bandit security scan (zero high/critical)
44
+ - Python 3.11 + 3.12 CI matrix
45
+ - Property-based tests (Hypothesis) for core algorithms
46
+ - Performance benchmarks with threshold validation
47
+
48
+ [0.1.0]: https://github.com/sovyx-ai/sovyx/releases/tag/v0.1.0
@@ -0,0 +1,85 @@
1
+ # Contributing to Sovyx
2
+
3
+ Thank you for your interest in contributing to Sovyx.
4
+
5
+ ## Setup
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.11+
10
+ - [uv](https://docs.astral.sh/uv/) (recommended) or pip
11
+ - Git
12
+
13
+ ### Getting Started
14
+
15
+ ```bash
16
+ # Clone the repository
17
+ git clone https://github.com/sovyx-ai/sovyx.git
18
+ cd sovyx
19
+
20
+ # Install dependencies (production + dev)
21
+ uv sync --dev
22
+
23
+ # Verify installation
24
+ uv run python -m sovyx
25
+ # → Sovyx v0.1.0
26
+ ```
27
+
28
+ ### Running Checks
29
+
30
+ ```bash
31
+ # Run all checks (lint + typecheck + security + tests)
32
+ make all
33
+
34
+ # Or individually:
35
+ make lint # ruff check
36
+ make typecheck # mypy --strict
37
+ make security # bandit
38
+ make test # pytest
39
+ make test-cov # pytest with coverage (≥95% required)
40
+
41
+ # Or use the script:
42
+ ./scripts/check.sh
43
+ ```
44
+
45
+ ## Quality Standards
46
+
47
+ All contributions must pass:
48
+
49
+ - **ruff** — zero warnings, formatted
50
+ - **mypy --strict** — zero errors, no `Any` except JSON boundaries
51
+ - **bandit** — zero high/critical findings
52
+ - **pytest** — all tests passing, ≥95% coverage per modified file
53
+ - **Docstrings** — on every public API
54
+
55
+ ## Code Style
56
+
57
+ - Python 3.11+, type hints everywhere
58
+ - Line length: 99 characters
59
+ - Imports: sorted by ruff (isort rules)
60
+ - Async: use `asyncio`, never `threading` for IO
61
+ - Errors: always inherit from `SovyxError` hierarchy
62
+ - Config: no hardcodes, use `SOVYX_` env prefix
63
+ - Tests: each test < 2s, async tests with 5s timeout
64
+
65
+ ## Commit Messages
66
+
67
+ One commit per logical change:
68
+
69
+ ```
70
+ feat: TASK-XX — Short description
71
+ fix: Brief description of the fix
72
+ docs: What was documented
73
+ test: What was tested
74
+ ```
75
+
76
+ ## Pull Requests
77
+
78
+ 1. Branch from `main`
79
+ 2. Run `make all` before pushing
80
+ 3. PR title: `feat: TASK-XX — Description`
81
+ 4. All CI checks must pass
82
+
83
+ ## License
84
+
85
+ By contributing, you agree that your contributions will be licensed under AGPL-3.0.
@@ -0,0 +1,19 @@
1
+ # Coverage Policy — Sovyx v0.1.x
2
+
3
+ ## pragma: no cover Audit (28 annotations)
4
+
5
+ All 28 `pragma: no cover` annotations have been audited and classified as **legitimate**.
6
+
7
+ ### Categories
8
+
9
+ | Module | Count | Reason |
10
+ |--------|-------|--------|
11
+ | `cli/main.py` | 12 | Click CLI commands with Rich console — require click.testing.CliRunner integration |
12
+ | `engine/health.py` | 10 | OS-level health checks (/proc, psutil, subprocess) — OS-dependent |
13
+ | `engine/lifecycle.py` | 4 | PidFile PermissionError, default paths, socket cleanup — OS-dependent |
14
+ | `cli/rpc_client.py` | 2 | Socket timeout/OS errors — not reproducible in unit tests |
15
+
16
+ ### Policy
17
+ - **No code logic is being masked.** All 28 are error handlers or OS-interaction paths.
18
+ - Removal target: v1.0 with proper integration test infrastructure.
19
+ - New `pragma: no cover` requires PR review justification.
sovyx-0.1.0/Dockerfile ADDED
@@ -0,0 +1,50 @@
1
+ # Sovyx — Sovereign Minds Engine
2
+ # Multi-stage build: build deps → slim runtime
3
+ # Supports: linux/amd64, linux/arm64
4
+
5
+ FROM python:3.12-slim AS build
6
+
7
+ WORKDIR /app
8
+ RUN pip install --no-cache-dir uv==0.10.11
9
+
10
+ # Copy dependency files first (cache layer)
11
+ COPY pyproject.toml uv.lock ./
12
+ RUN uv sync --no-dev --frozen
13
+
14
+ # Copy source
15
+ COPY src/ ./src/
16
+ RUN uv pip install --no-deps .
17
+
18
+ # ── Runtime ──────────────────────────────────────────────────────────────────
19
+
20
+ FROM python:3.12-slim AS runtime
21
+
22
+ LABEL org.opencontainers.image.title="Sovyx" \
23
+ org.opencontainers.image.description="Sovereign Minds Engine" \
24
+ org.opencontainers.image.source="https://github.com/sovyx-ai/sovyx" \
25
+ org.opencontainers.image.licenses="AGPL-3.0" \
26
+ org.opencontainers.image.version="0.1.0"
27
+
28
+ # Create non-root user
29
+ RUN groupadd --system sovyx && \
30
+ useradd --system --gid sovyx --create-home sovyx
31
+
32
+ WORKDIR /app
33
+
34
+ # Copy virtual environment from build stage
35
+ COPY --from=build /app/.venv /app/.venv
36
+ ENV PATH="/app/.venv/bin:$PATH" \
37
+ SOVYX_DATA_DIR="/data" \
38
+ PYTHONUNBUFFERED=1
39
+
40
+ # Create data directory
41
+ RUN mkdir -p /data && chown sovyx:sovyx /data
42
+ VOLUME ["/data"]
43
+
44
+ USER sovyx
45
+
46
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
47
+ CMD ["sovyx", "doctor"] || exit 1
48
+
49
+ ENTRYPOINT ["sovyx"]
50
+ CMD ["start", "--foreground"]