mnemonn 1.0.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 (64) hide show
  1. mnemonn-1.0.0/.github/workflows/ci.yml +57 -0
  2. mnemonn-1.0.0/.github/workflows/release.yml +179 -0
  3. mnemonn-1.0.0/.gitignore +248 -0
  4. mnemonn-1.0.0/.python-version +1 -0
  5. mnemonn-1.0.0/CHANGELOG.md +4 -0
  6. mnemonn-1.0.0/LICENSE +674 -0
  7. mnemonn-1.0.0/PKG-INFO +412 -0
  8. mnemonn-1.0.0/README.md +373 -0
  9. mnemonn-1.0.0/cliff.toml +46 -0
  10. mnemonn-1.0.0/git-hooks/post-commit +20 -0
  11. mnemonn-1.0.0/git-hooks/post-merge +20 -0
  12. mnemonn-1.0.0/install-hooks.sh +17 -0
  13. mnemonn-1.0.0/install.ps1 +22 -0
  14. mnemonn-1.0.0/install.sh +47 -0
  15. mnemonn-1.0.0/pyproject.toml +152 -0
  16. mnemonn-1.0.0/pytest.ini +7 -0
  17. mnemonn-1.0.0/src/mnemon/.python-version +1 -0
  18. mnemonn-1.0.0/src/mnemon/__init__.py +0 -0
  19. mnemonn-1.0.0/src/mnemon/__main__.py +10 -0
  20. mnemonn-1.0.0/src/mnemon/cli.py +686 -0
  21. mnemonn-1.0.0/src/mnemon/commands/__init__.py +30 -0
  22. mnemonn-1.0.0/src/mnemon/commands/_utils.py +278 -0
  23. mnemonn-1.0.0/src/mnemon/contracts/__init__.py +69 -0
  24. mnemonn-1.0.0/src/mnemon/contracts/graph_contracts.py +124 -0
  25. mnemonn-1.0.0/src/mnemon/contracts/memory_contracts.py +177 -0
  26. mnemonn-1.0.0/src/mnemon/contracts/project_contracts.py +70 -0
  27. mnemonn-1.0.0/src/mnemon/contracts/registry.py +151 -0
  28. mnemonn-1.0.0/src/mnemon/core/__init__.py +0 -0
  29. mnemonn-1.0.0/src/mnemon/core/constants.py +161 -0
  30. mnemonn-1.0.0/src/mnemon/core/context.py +99 -0
  31. mnemonn-1.0.0/src/mnemon/core/git.py +66 -0
  32. mnemonn-1.0.0/src/mnemon/core/graph.py +296 -0
  33. mnemonn-1.0.0/src/mnemon/core/memory.py +203 -0
  34. mnemonn-1.0.0/src/mnemon/core/projects.py +270 -0
  35. mnemonn-1.0.0/src/mnemon/db/__init__.py +0 -0
  36. mnemonn-1.0.0/src/mnemon/db/connection.py +59 -0
  37. mnemonn-1.0.0/src/mnemon/db/migrations.py +116 -0
  38. mnemonn-1.0.0/src/mnemon/server.py +437 -0
  39. mnemonn-1.0.0/src/mnemon/skill/SKILL.md +159 -0
  40. mnemonn-1.0.0/tests/__init__.py +0 -0
  41. mnemonn-1.0.0/tests/conftest.py +190 -0
  42. mnemonn-1.0.0/tests/samples/__init__.py +1 -0
  43. mnemonn-1.0.0/tests/samples/complex_graph.sql +6 -0
  44. mnemonn-1.0.0/tests/samples/empty.sql +1 -0
  45. mnemonn-1.0.0/tests/samples/malformed_input.txt +3 -0
  46. mnemonn-1.0.0/tests/samples/simple_entity.sql +3 -0
  47. mnemonn-1.0.0/tests/samples/simple_session.json +10 -0
  48. mnemonn-1.0.0/tests/test_cli/__init__.py +0 -0
  49. mnemonn-1.0.0/tests/test_cli/test_behavior.py +257 -0
  50. mnemonn-1.0.0/tests/test_cli/test_commands.py +82 -0
  51. mnemonn-1.0.0/tests/test_contracts.py +169 -0
  52. mnemonn-1.0.0/tests/test_core/__init__.py +0 -0
  53. mnemonn-1.0.0/tests/test_core/test_constants.py +127 -0
  54. mnemonn-1.0.0/tests/test_core/test_context.py +94 -0
  55. mnemonn-1.0.0/tests/test_core/test_git.py +58 -0
  56. mnemonn-1.0.0/tests/test_core/test_graph.py +238 -0
  57. mnemonn-1.0.0/tests/test_core/test_memory.py +202 -0
  58. mnemonn-1.0.0/tests/test_core/test_projects.py +119 -0
  59. mnemonn-1.0.0/tests/test_coverage_gap.py +205 -0
  60. mnemonn-1.0.0/tests/test_db/__init__.py +0 -0
  61. mnemonn-1.0.0/tests/test_db/test_connection.py +80 -0
  62. mnemonn-1.0.0/tests/test_db/test_migrations.py +64 -0
  63. mnemonn-1.0.0/tests/test_server.py +147 -0
  64. mnemonn-1.0.0/uv.lock +1393 -0
@@ -0,0 +1,57 @@
1
+ # .github/workflows/ci.yml
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ pull_request:
8
+ branches: [main]
9
+
10
+ jobs:
11
+ lint:
12
+ name: Lint & type-check
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ enable-cache: true
21
+
22
+ - name: Set up Python
23
+ run: uv python install
24
+
25
+ - name: Install dependencies
26
+ run: uv sync --all-extras --group dev
27
+
28
+ - name: Ruff lint
29
+ run: uv run ruff check .
30
+
31
+ - name: Mypy
32
+ run: uv run mypy src/
33
+
34
+ - name: Pyright
35
+ run: uv run pyright src/
36
+
37
+ test:
38
+ name: Test (Python ${{ matrix.python-version }})
39
+ runs-on: ubuntu-latest
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+
47
+ - name: Install uv
48
+ uses: astral-sh/setup-uv@v5
49
+ with:
50
+ enable-cache: true
51
+ python-version: ${{ matrix.python-version }}
52
+
53
+ - name: Install dependencies
54
+ run: uv sync --all-extras --group dev
55
+
56
+ - name: Run tests
57
+ run: uv run pytest --cov --cov-report=xml -v
@@ -0,0 +1,179 @@
1
+ # .github/workflows/release.yml
2
+ name: Release
3
+
4
+ on:
5
+ push:
6
+ tags:
7
+ - "v*.*.*"
8
+
9
+ permissions:
10
+ contents: write # needed to create releases and upload assets
11
+ id-token: write # needed for PyPI OIDC publishing
12
+
13
+ jobs:
14
+ # ── 1. Generate changelog ─────────────────────────────────────────────────
15
+ changelog:
16
+ name: Generate changelog
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ release_body: ${{ steps.cliff.outputs.content }}
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ fetch-depth: 0 # full history required by git-cliff
24
+
25
+ - name: Generate release notes with git-cliff
26
+ id: cliff
27
+ uses: orhun/git-cliff-action@v4
28
+ with:
29
+ config: cliff.toml
30
+ args: --latest --strip header
31
+ env:
32
+ OUTPUT: CHANGES.md
33
+ GITHUB_REPO: ${{ github.repository }}
34
+
35
+ # ── 2. Build standalone binaries (PyInstaller) ────────────────────────────
36
+ build-binaries:
37
+ name: Build binary (${{ matrix.os }})
38
+ needs: changelog
39
+ runs-on: ${{ matrix.os }}
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ include:
44
+ - os: ubuntu-latest
45
+ asset_name: mnemon-linux-x86_64
46
+ artifact_suffix: linux-x86_64
47
+ - os: macos-latest # Apple Silicon (M-series)
48
+ asset_name: mnemon-macos-aarch64
49
+ artifact_suffix: macos-aarch64
50
+ - os: windows-latest
51
+ asset_name: mnemon-windows-x86_64.exe
52
+ artifact_suffix: windows-x86_64
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+
56
+ - name: Install uv
57
+ uses: astral-sh/setup-uv@v5
58
+ with:
59
+ enable-cache: true
60
+
61
+ - name: Update version to match tag
62
+ shell: bash
63
+ run: |
64
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
65
+ sed -i.bak "s/^version = \".*\"/version = \"${TAG_VERSION}\"/" pyproject.toml
66
+ rm -f pyproject.toml.bak
67
+ uv lock
68
+
69
+ - name: Install project + PyInstaller
70
+ # --frozen ensures CI uses the committed uv.lock exactly — no silent dep drift
71
+ run: uv sync --frozen --all-extras
72
+
73
+ - name: Build binary (Linux / macOS)
74
+ if: runner.os != 'Windows'
75
+ run: |
76
+ uv run pyinstaller \
77
+ --onefile \
78
+ --name "${{ matrix.asset_name }}" \
79
+ --add-data "src/mnemon/skill/SKILL.md:mnemon/skill" \
80
+ src/mnemon/__main__.py
81
+
82
+ - name: Build binary (Windows)
83
+ if: runner.os == 'Windows'
84
+ run: |
85
+ uv run pyinstaller `
86
+ --onefile `
87
+ --name "${{ matrix.asset_name }}" `
88
+ --add-data "src/mnemon/skill/SKILL.md;mnemon/skill" `
89
+ src/mnemon/__main__.py
90
+
91
+ - name: Upload binary artifact
92
+ uses: actions/upload-artifact@v4
93
+ with:
94
+ name: binary-${{ matrix.artifact_suffix }}
95
+ path: dist/${{ matrix.asset_name }}*
96
+ retention-days: 1
97
+
98
+ # ── 3. Build Python distribution (wheel + sdist) ─────────────────────────
99
+ build-python:
100
+ name: Build Python package
101
+ needs: changelog
102
+ runs-on: ubuntu-latest
103
+ steps:
104
+ - uses: actions/checkout@v4
105
+
106
+ - name: Install uv
107
+ uses: astral-sh/setup-uv@v5
108
+ with:
109
+ enable-cache: true
110
+
111
+ - name: Update version to match tag
112
+ shell: bash
113
+ run: |
114
+ TAG_VERSION="${GITHUB_REF_NAME#v}"
115
+ sed -i.bak "s/^version = \".*\"/version = \"${TAG_VERSION}\"/" pyproject.toml
116
+ rm -f pyproject.toml.bak
117
+ uv lock
118
+
119
+ - name: Build wheel and source distribution
120
+ run: uv build
121
+
122
+ - name: Upload dist artifacts
123
+ uses: actions/upload-artifact@v4
124
+ with:
125
+ name: python-dist
126
+ path: dist/
127
+ retention-days: 1
128
+
129
+ # ── 4. Create GitHub Release ──────────────────────────────────────────────
130
+ create-release:
131
+ name: Create GitHub Release
132
+ needs: [changelog, build-binaries, build-python]
133
+ runs-on: ubuntu-latest
134
+ steps:
135
+ - uses: actions/checkout@v4
136
+
137
+ - name: Download all artifacts
138
+ uses: actions/download-artifact@v4
139
+ with:
140
+ path: release-assets/
141
+ merge-multiple: true
142
+
143
+ - name: Create release and upload assets
144
+ uses: softprops/action-gh-release@v2
145
+ with:
146
+ tag_name: ${{ github.ref_name }}
147
+ name: "${{ github.ref_name }}"
148
+ body: ${{ needs.changelog.outputs.release_body }}
149
+ draft: false
150
+ prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
151
+ files: release-assets/**/*
152
+ env:
153
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154
+
155
+ # ── 5. Publish to PyPI ────────────────────────────────────────────────────
156
+ publish-pypi:
157
+ name: Publish to PyPI
158
+ needs: [create-release]
159
+ runs-on: ubuntu-latest
160
+ environment:
161
+ name: pypi
162
+ url: https://pypi.org/project/mnemonn/
163
+ steps:
164
+ - uses: actions/checkout@v4
165
+
166
+ - name: Download python dist artifacts
167
+ uses: actions/download-artifact@v4
168
+ with:
169
+ name: python-dist
170
+ path: dist/
171
+
172
+ - name: Install uv
173
+ uses: astral-sh/setup-uv@v5
174
+ with:
175
+ enable-cache: true
176
+
177
+ - name: Publish to PyPI (OIDC — no token needed)
178
+ run: uv publish --trusted-publishing always
179
+
@@ -0,0 +1,248 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,macos,linux
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,python,macos,linux
3
+
4
+ ### Linux ###
5
+ *~
6
+
7
+ # temporary files which can be created if a process still has a handle open of a deleted file
8
+ .fuse_hidden*
9
+
10
+ # KDE directory preferences
11
+ .directory
12
+
13
+ # Linux trash folder which might appear on any partition or disk
14
+ .Trash-*
15
+
16
+ # .nfs files are created when an open file is removed but is still being accessed
17
+ .nfs*
18
+
19
+ ### macOS ###
20
+ # General
21
+ .DS_Store
22
+ .AppleDouble
23
+ .LSOverride
24
+
25
+ # Icon must end with two \r
26
+ Icon
27
+
28
+
29
+ # Thumbnails
30
+ ._*
31
+
32
+ # Files that might appear in the root of a volume
33
+ .DocumentRevisions-V100
34
+ .fseventsd
35
+ .Spotlight-V100
36
+ .TemporaryItems
37
+ .Trashes
38
+ .VolumeIcon.icns
39
+ .com.apple.timemachine.donotpresent
40
+
41
+ # Directories potentially created on remote AFP share
42
+ .AppleDB
43
+ .AppleDesktop
44
+ Network Trash Folder
45
+ Temporary Items
46
+ .apdisk
47
+
48
+ ### macOS Patch ###
49
+ # iCloud generated files
50
+ *.icloud
51
+
52
+ ### Python ###
53
+ # Byte-compiled / optimized / DLL files
54
+ __pycache__/
55
+ *.py[cod]
56
+ *$py.class
57
+
58
+ # C extensions
59
+ *.so
60
+
61
+ # Distribution / packaging
62
+ .Python
63
+ build/
64
+ develop-eggs/
65
+ dist/
66
+ downloads/
67
+ eggs/
68
+ .eggs/
69
+ lib/
70
+ lib64/
71
+ parts/
72
+ sdist/
73
+ var/
74
+ wheels/
75
+ share/python-wheels/
76
+ *.egg-info/
77
+ .installed.cfg
78
+ *.egg
79
+ MANIFEST
80
+
81
+ # PyInstaller
82
+ # Usually these files are written by a python script from a template
83
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
84
+ *.manifest
85
+ *.spec
86
+
87
+ # Installer logs
88
+ pip-log.txt
89
+ pip-delete-this-directory.txt
90
+
91
+ # Unit test / coverage reports
92
+ htmlcov/
93
+ .tox/
94
+ .nox/
95
+ .coverage
96
+ .coverage.*
97
+ .cache
98
+ nosetests.xml
99
+ coverage.xml
100
+ *.cover
101
+ *.py,cover
102
+ .hypothesis/
103
+ .pytest_cache/
104
+ cover/
105
+
106
+ # Translations
107
+ *.mo
108
+ *.pot
109
+
110
+ # Django stuff:
111
+ *.log
112
+ local_settings.py
113
+ db.sqlite3
114
+ db.sqlite3-journal
115
+
116
+ # Flask stuff:
117
+ instance/
118
+ .webassets-cache
119
+
120
+ # Scrapy stuff:
121
+ .scrapy
122
+
123
+ # Sphinx documentation
124
+ docs/_build/
125
+
126
+ # PyBuilder
127
+ .pybuilder/
128
+ target/
129
+
130
+ # Jupyter Notebook
131
+ .ipynb_checkpoints
132
+
133
+ # IPython
134
+ profile_default/
135
+ ipython_config.py
136
+
137
+ # pyenv
138
+ # For a library or package, you might want to ignore these files since the code is
139
+ # intended to run in multiple environments; otherwise, check them in:
140
+ # .python-version
141
+
142
+ # pipenv
143
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
144
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
145
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
146
+ # install all needed dependencies.
147
+ #Pipfile.lock
148
+
149
+ # poetry
150
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
151
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
152
+ # commonly ignored for libraries.
153
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
154
+ #poetry.lock
155
+
156
+ # pdm
157
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
158
+ #pdm.lock
159
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
160
+ # in version control.
161
+ # https://pdm.fming.dev/#use-with-ide
162
+ .pdm.toml
163
+
164
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
165
+ __pypackages__/
166
+
167
+ # Celery stuff
168
+ celerybeat-schedule
169
+ celerybeat.pid
170
+
171
+ # SageMath parsed files
172
+ *.sage.py
173
+
174
+ # Environments
175
+ .env
176
+ .venv
177
+ env/
178
+ venv/
179
+ ENV/
180
+ env.bak/
181
+ venv.bak/
182
+
183
+ # Spyder project settings
184
+ .spyderproject
185
+ .spyproject
186
+
187
+ # Rope project settings
188
+ .ropeproject
189
+
190
+ # mkdocs documentation
191
+ /site
192
+
193
+ # mypy
194
+ .mypy_cache/
195
+ .dmypy.json
196
+ dmypy.json
197
+
198
+ # Pyre type checker
199
+ .pyre/
200
+
201
+ # pytype static type analyzer
202
+ .pytype/
203
+
204
+ # Cython debug symbols
205
+ cython_debug/
206
+
207
+ # PyCharm
208
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
209
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
210
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
211
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
212
+ #.idea/
213
+
214
+ ### Python Patch ###
215
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
216
+ poetry.toml
217
+
218
+ # ruff
219
+ .ruff_cache/
220
+
221
+ # LSP config files
222
+ pyrightconfig.json
223
+
224
+ ### VisualStudioCode ###
225
+ .vscode/*
226
+ !.vscode/settings.json
227
+ !.vscode/tasks.json
228
+ !.vscode/launch.json
229
+ !.vscode/extensions.json
230
+ !.vscode/*.code-snippets
231
+
232
+ # Local History for Visual Studio Code
233
+ .history/
234
+
235
+ # Built Visual Studio Code Extensions
236
+ *.vsix
237
+
238
+ ### VisualStudioCode Patch ###
239
+ # Ignore all local history of files
240
+ .history
241
+ .ionide
242
+
243
+ # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,macos,linux
244
+
245
+ .temp/
246
+
247
+ # git-cliff
248
+ CHANGES.md
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ Generated by [git-cliff](https://github.com/orhun/git-cliff).