Skip to content

Commit 9a2968d

Browse files
author
ChidcGithub
committed
Initial commit: CogniPy v0.1.0
- Core features: ~ operator, @cognitive decorator - Memory management with pluggable backends - Reflection loop for self-correction - Async scheduler with priority queue - Deterministic guarantees with type constraints - Hallucination detection - CLI tools: run, repl - 68 tests passing
0 parents  commit 9a2968d

20 files changed

Lines changed: 3944 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
python-version: ['3.10', '3.11', '3.12', '3.13']
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Cache pip
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.cache/pip
32+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-${{ matrix.python-version }}-
35+
${{ runner.os }}-pip-
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
pip install -e ".[dev]"
41+
42+
- name: Run tests
43+
run: |
44+
pytest tests/ -v --tb=short
45+
46+
- name: Upload coverage
47+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
48+
uses: codecov/codecov-action@v4
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
files: ./coverage.xml
52+
fail_ci_if_error: false
53+
54+
lint:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Set up Python
60+
uses: actions/setup-python@v5
61+
with:
62+
python-version: '3.12'
63+
64+
- name: Install linters
65+
run: |
66+
pip install ruff mypy
67+
68+
- name: Run ruff
69+
run: ruff check cognipy/ --output-format=github
70+
71+
- name: Run mypy
72+
run: mypy cognipy/ --ignore-missing-imports
73+
continue-on-error: true
74+
75+
build:
76+
needs: [test, lint]
77+
runs-on: ubuntu-latest
78+
steps:
79+
- uses: actions/checkout@v4
80+
81+
- name: Set up Python
82+
uses: actions/setup-python@v5
83+
with:
84+
python-version: '3.12'
85+
86+
- name: Install build tools
87+
run: |
88+
pip install build twine
89+
90+
- name: Build package
91+
run: python -m build
92+
93+
- name: Check package
94+
run: twine check dist/*
95+
96+
- name: Upload artifacts
97+
uses: actions/upload-artifact@v4
98+
with:
99+
name: dist
100+
path: dist/
101+
102+
publish:
103+
needs: build
104+
runs-on: ubuntu-latest
105+
if: github.event_name == 'release'
106+
permissions:
107+
id-token: write
108+
109+
steps:
110+
- uses: actions/checkout@v4
111+
112+
- name: Download artifacts
113+
uses: actions/download-artifact@v4
114+
with:
115+
name: dist
116+
path: dist/
117+
118+
- name: Publish to PyPI
119+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
*.manifest
30+
*.spec
31+
32+
# Installer logs
33+
pip-log.txt
34+
pip-delete-this-directory.txt
35+
36+
# Unit test / coverage reports
37+
htmlcov/
38+
.tox/
39+
.nox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*.cover
46+
*.py,cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Environments
55+
.env
56+
.venv
57+
env/
58+
venv/
59+
ENV/
60+
env.bak/
61+
venv.bak/
62+
63+
# IDEs
64+
.idea/
65+
.vscode/
66+
*.swp
67+
*.swo
68+
*~
69+
70+
# OS
71+
.DS_Store
72+
Thumbs.db
73+
74+
# Project specific
75+
*.json
76+
!pyproject.json
77+
recordings/
78+
sessions/
79+
memory.md

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 CogniPy Team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)