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.
- sovyx-0.1.0/.dockerignore +16 -0
- sovyx-0.1.0/.github/workflows/ci.yml +84 -0
- sovyx-0.1.0/.github/workflows/docker.yml +51 -0
- sovyx-0.1.0/.github/workflows/publish.yml +27 -0
- sovyx-0.1.0/.gitignore +59 -0
- sovyx-0.1.0/.pre-commit-config.yaml +20 -0
- sovyx-0.1.0/CHANGELOG.md +48 -0
- sovyx-0.1.0/CONTRIBUTING.md +85 -0
- sovyx-0.1.0/COVERAGE.md +19 -0
- sovyx-0.1.0/Dockerfile +50 -0
- sovyx-0.1.0/LICENSE +661 -0
- sovyx-0.1.0/Makefile +29 -0
- sovyx-0.1.0/PKG-INFO +197 -0
- sovyx-0.1.0/README.md +153 -0
- sovyx-0.1.0/benchmarks/__init__.py +1 -0
- sovyx-0.1.0/benchmarks/bench_brain.py +119 -0
- sovyx-0.1.0/benchmarks/bench_cogloop.py +120 -0
- sovyx-0.1.0/docker-compose.yml +23 -0
- sovyx-0.1.0/docs/architecture.md +99 -0
- sovyx-0.1.0/docs/configuration.md +66 -0
- sovyx-0.1.0/docs/quickstart.md +70 -0
- sovyx-0.1.0/pyproject.toml +104 -0
- sovyx-0.1.0/scripts/check.sh +27 -0
- sovyx-0.1.0/scripts/install.sh +43 -0
- sovyx-0.1.0/sovyx.service +24 -0
- sovyx-0.1.0/src/sovyx/__init__.py +6 -0
- sovyx-0.1.0/src/sovyx/__main__.py +12 -0
- sovyx-0.1.0/src/sovyx/brain/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/brain/concept_repo.py +292 -0
- sovyx-0.1.0/src/sovyx/brain/consolidation.py +150 -0
- sovyx-0.1.0/src/sovyx/brain/embedding.py +349 -0
- sovyx-0.1.0/src/sovyx/brain/episode_repo.py +209 -0
- sovyx-0.1.0/src/sovyx/brain/learning.py +203 -0
- sovyx-0.1.0/src/sovyx/brain/models.py +84 -0
- sovyx-0.1.0/src/sovyx/brain/relation_repo.py +271 -0
- sovyx-0.1.0/src/sovyx/brain/retrieval.py +182 -0
- sovyx-0.1.0/src/sovyx/brain/service.py +288 -0
- sovyx-0.1.0/src/sovyx/brain/spreading.py +128 -0
- sovyx-0.1.0/src/sovyx/brain/working_memory.py +104 -0
- sovyx-0.1.0/src/sovyx/bridge/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/bridge/channels/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/bridge/channels/telegram.py +178 -0
- sovyx-0.1.0/src/sovyx/bridge/identity.py +111 -0
- sovyx-0.1.0/src/sovyx/bridge/manager.py +268 -0
- sovyx-0.1.0/src/sovyx/bridge/protocol.py +55 -0
- sovyx-0.1.0/src/sovyx/bridge/sessions.py +171 -0
- sovyx-0.1.0/src/sovyx/cli/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/cli/commands/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/cli/main.py +295 -0
- sovyx-0.1.0/src/sovyx/cli/rpc_client.py +103 -0
- sovyx-0.1.0/src/sovyx/cognitive/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/cognitive/act.py +122 -0
- sovyx-0.1.0/src/sovyx/cognitive/attend.py +90 -0
- sovyx-0.1.0/src/sovyx/cognitive/gate.py +135 -0
- sovyx-0.1.0/src/sovyx/cognitive/loop.py +155 -0
- sovyx-0.1.0/src/sovyx/cognitive/perceive.py +155 -0
- sovyx-0.1.0/src/sovyx/cognitive/reflect.py +139 -0
- sovyx-0.1.0/src/sovyx/cognitive/state.py +77 -0
- sovyx-0.1.0/src/sovyx/cognitive/think.py +114 -0
- sovyx-0.1.0/src/sovyx/context/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/context/assembler.py +203 -0
- sovyx-0.1.0/src/sovyx/context/budget.py +156 -0
- sovyx-0.1.0/src/sovyx/context/formatter.py +184 -0
- sovyx-0.1.0/src/sovyx/context/tokenizer.py +108 -0
- sovyx-0.1.0/src/sovyx/engine/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/engine/bootstrap.py +316 -0
- sovyx-0.1.0/src/sovyx/engine/config.py +194 -0
- sovyx-0.1.0/src/sovyx/engine/degradation.py +170 -0
- sovyx-0.1.0/src/sovyx/engine/errors.py +236 -0
- sovyx-0.1.0/src/sovyx/engine/events.py +296 -0
- sovyx-0.1.0/src/sovyx/engine/health.py +255 -0
- sovyx-0.1.0/src/sovyx/engine/lifecycle.py +269 -0
- sovyx-0.1.0/src/sovyx/engine/protocols.py +184 -0
- sovyx-0.1.0/src/sovyx/engine/registry.py +139 -0
- sovyx-0.1.0/src/sovyx/engine/rpc_protocol.py +75 -0
- sovyx-0.1.0/src/sovyx/engine/rpc_server.py +119 -0
- sovyx-0.1.0/src/sovyx/engine/types.py +99 -0
- sovyx-0.1.0/src/sovyx/llm/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/llm/circuit.py +65 -0
- sovyx-0.1.0/src/sovyx/llm/cost.py +193 -0
- sovyx-0.1.0/src/sovyx/llm/models.py +39 -0
- sovyx-0.1.0/src/sovyx/llm/providers/__init__.py +0 -0
- sovyx-0.1.0/src/sovyx/llm/providers/_shared.py +92 -0
- sovyx-0.1.0/src/sovyx/llm/providers/anthropic.py +189 -0
- sovyx-0.1.0/src/sovyx/llm/providers/ollama.py +155 -0
- sovyx-0.1.0/src/sovyx/llm/providers/openai.py +170 -0
- sovyx-0.1.0/src/sovyx/llm/router.py +200 -0
- sovyx-0.1.0/src/sovyx/mind/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/mind/config.py +206 -0
- sovyx-0.1.0/src/sovyx/mind/personality.py +200 -0
- sovyx-0.1.0/src/sovyx/observability/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/observability/logging.py +162 -0
- sovyx-0.1.0/src/sovyx/persistence/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/persistence/datetime_utils.py +55 -0
- sovyx-0.1.0/src/sovyx/persistence/manager.py +193 -0
- sovyx-0.1.0/src/sovyx/persistence/migrations.py +277 -0
- sovyx-0.1.0/src/sovyx/persistence/pool.py +273 -0
- sovyx-0.1.0/src/sovyx/persistence/schemas/__init__.py +1 -0
- sovyx-0.1.0/src/sovyx/persistence/schemas/brain.py +161 -0
- sovyx-0.1.0/src/sovyx/persistence/schemas/conversations.py +75 -0
- sovyx-0.1.0/src/sovyx/persistence/schemas/system.py +55 -0
- sovyx-0.1.0/src/sovyx/py.typed +0 -0
- sovyx-0.1.0/tests/__init__.py +1 -0
- sovyx-0.1.0/tests/conftest.py +26 -0
- sovyx-0.1.0/tests/integration/__init__.py +1 -0
- sovyx-0.1.0/tests/integration/test_brain_roundtrip.py +162 -0
- sovyx-0.1.0/tests/integration/test_cognitive_pipeline.py +191 -0
- sovyx-0.1.0/tests/unit/__init__.py +1 -0
- sovyx-0.1.0/tests/unit/brain/__init__.py +1 -0
- sovyx-0.1.0/tests/unit/brain/test_concept_repo.py +361 -0
- sovyx-0.1.0/tests/unit/brain/test_consolidation.py +202 -0
- sovyx-0.1.0/tests/unit/brain/test_embedding.py +444 -0
- sovyx-0.1.0/tests/unit/brain/test_episode_repo.py +294 -0
- sovyx-0.1.0/tests/unit/brain/test_learning.py +338 -0
- sovyx-0.1.0/tests/unit/brain/test_models.py +90 -0
- sovyx-0.1.0/tests/unit/brain/test_relation_repo.py +206 -0
- sovyx-0.1.0/tests/unit/brain/test_retrieval.py +246 -0
- sovyx-0.1.0/tests/unit/brain/test_service.py +375 -0
- sovyx-0.1.0/tests/unit/brain/test_spreading.py +277 -0
- sovyx-0.1.0/tests/unit/brain/test_working_memory.py +148 -0
- sovyx-0.1.0/tests/unit/bridge/__init__.py +0 -0
- sovyx-0.1.0/tests/unit/bridge/test_identity.py +120 -0
- sovyx-0.1.0/tests/unit/bridge/test_manager.py +337 -0
- sovyx-0.1.0/tests/unit/bridge/test_protocol.py +67 -0
- sovyx-0.1.0/tests/unit/bridge/test_sessions.py +173 -0
- sovyx-0.1.0/tests/unit/bridge/test_telegram.py +261 -0
- sovyx-0.1.0/tests/unit/cli/__init__.py +1 -0
- sovyx-0.1.0/tests/unit/cli/test_main.py +195 -0
- sovyx-0.1.0/tests/unit/cognitive/__init__.py +0 -0
- sovyx-0.1.0/tests/unit/cognitive/test_act.py +100 -0
- sovyx-0.1.0/tests/unit/cognitive/test_attend.py +62 -0
- sovyx-0.1.0/tests/unit/cognitive/test_gate.py +162 -0
- sovyx-0.1.0/tests/unit/cognitive/test_loop.py +197 -0
- sovyx-0.1.0/tests/unit/cognitive/test_perceive.py +100 -0
- sovyx-0.1.0/tests/unit/cognitive/test_reflect.py +145 -0
- sovyx-0.1.0/tests/unit/cognitive/test_state.py +200 -0
- sovyx-0.1.0/tests/unit/cognitive/test_think.py +129 -0
- sovyx-0.1.0/tests/unit/context/__init__.py +0 -0
- sovyx-0.1.0/tests/unit/context/test_assembler.py +274 -0
- sovyx-0.1.0/tests/unit/context/test_budget.py +137 -0
- sovyx-0.1.0/tests/unit/context/test_formatter.py +222 -0
- sovyx-0.1.0/tests/unit/context/test_tokenizer.py +171 -0
- sovyx-0.1.0/tests/unit/engine/__init__.py +1 -0
- sovyx-0.1.0/tests/unit/engine/test_bootstrap.py +159 -0
- sovyx-0.1.0/tests/unit/engine/test_config.py +253 -0
- sovyx-0.1.0/tests/unit/engine/test_degradation.py +139 -0
- sovyx-0.1.0/tests/unit/engine/test_errors.py +296 -0
- sovyx-0.1.0/tests/unit/engine/test_events.py +276 -0
- sovyx-0.1.0/tests/unit/engine/test_health.py +263 -0
- sovyx-0.1.0/tests/unit/engine/test_lifecycle.py +198 -0
- sovyx-0.1.0/tests/unit/engine/test_protocols.py +285 -0
- sovyx-0.1.0/tests/unit/engine/test_registry.py +162 -0
- sovyx-0.1.0/tests/unit/engine/test_rpc.py +172 -0
- sovyx-0.1.0/tests/unit/engine/test_rpc_protocol.py +94 -0
- sovyx-0.1.0/tests/unit/engine/test_types.py +156 -0
- sovyx-0.1.0/tests/unit/llm/__init__.py +0 -0
- sovyx-0.1.0/tests/unit/llm/test_circuit.py +102 -0
- sovyx-0.1.0/tests/unit/llm/test_cost.py +153 -0
- sovyx-0.1.0/tests/unit/llm/test_models.py +47 -0
- sovyx-0.1.0/tests/unit/llm/test_providers.py +337 -0
- sovyx-0.1.0/tests/unit/llm/test_router.py +206 -0
- sovyx-0.1.0/tests/unit/llm/test_shared_utils.py +140 -0
- sovyx-0.1.0/tests/unit/mind/__init__.py +0 -0
- sovyx-0.1.0/tests/unit/mind/test_config.py +281 -0
- sovyx-0.1.0/tests/unit/mind/test_personality.py +228 -0
- sovyx-0.1.0/tests/unit/observability/__init__.py +1 -0
- sovyx-0.1.0/tests/unit/observability/test_logging.py +201 -0
- sovyx-0.1.0/tests/unit/persistence/__init__.py +1 -0
- sovyx-0.1.0/tests/unit/persistence/test_brain_schema.py +248 -0
- sovyx-0.1.0/tests/unit/persistence/test_conversation_schema.py +170 -0
- sovyx-0.1.0/tests/unit/persistence/test_datetime_utils.py +61 -0
- sovyx-0.1.0/tests/unit/persistence/test_manager.py +158 -0
- sovyx-0.1.0/tests/unit/persistence/test_migrations.py +349 -0
- sovyx-0.1.0/tests/unit/persistence/test_pool.py +394 -0
- sovyx-0.1.0/tests/unit/persistence/test_system_schema.py +138 -0
- sovyx-0.1.0/tests/unit/test_benchmarks.py +66 -0
- sovyx-0.1.0/tests/unit/test_brain_properties.py +112 -0
- sovyx-0.1.0/tests/unit/test_cogloop_properties.py +105 -0
- sovyx-0.1.0/tests/unit/test_edge_cases.py +112 -0
- sovyx-0.1.0/tests/unit/test_init.py +119 -0
- sovyx-0.1.0/tests/unit/test_packaging.py +48 -0
- sovyx-0.1.0/uv.lock +2113 -0
|
@@ -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/
|
sovyx-0.1.0/CHANGELOG.md
ADDED
|
@@ -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.
|
sovyx-0.1.0/COVERAGE.md
ADDED
|
@@ -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"]
|