memgit 0.3.1__tar.gz → 0.5.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 (45) hide show
  1. {memgit-0.3.1 → memgit-0.5.0}/PKG-INFO +36 -7
  2. {memgit-0.3.1 → memgit-0.5.0}/README.md +35 -6
  3. {memgit-0.3.1 → memgit-0.5.0}/memgit/__init__.py +1 -1
  4. {memgit-0.3.1 → memgit-0.5.0}/memgit/cli.py +422 -64
  5. memgit-0.5.0/memgit/delivery.py +341 -0
  6. memgit-0.5.0/memgit/hooks.py +219 -0
  7. {memgit-0.3.1 → memgit-0.5.0}/memgit/importer.py +12 -31
  8. {memgit-0.3.1 → memgit-0.5.0}/memgit/mcp_server.py +49 -9
  9. memgit-0.5.0/memgit/project.py +90 -0
  10. {memgit-0.3.1 → memgit-0.5.0}/memgit/repo.py +63 -9
  11. {memgit-0.3.1 → memgit-0.5.0}/memgit/scorer.py +13 -4
  12. {memgit-0.3.1 → memgit-0.5.0}/memgit/toon.py +35 -8
  13. memgit-0.5.0/memgit/usage.py +73 -0
  14. {memgit-0.3.1 → memgit-0.5.0}/memgit.egg-info/PKG-INFO +36 -7
  15. {memgit-0.3.1 → memgit-0.5.0}/memgit.egg-info/SOURCES.txt +10 -1
  16. {memgit-0.3.1 → memgit-0.5.0}/pyproject.toml +1 -1
  17. memgit-0.5.0/tests/test_accrue.py +110 -0
  18. memgit-0.5.0/tests/test_aliases.py +64 -0
  19. memgit-0.5.0/tests/test_core.py +75 -0
  20. memgit-0.5.0/tests/test_delivery.py +121 -0
  21. memgit-0.5.0/tests/test_v040.py +371 -0
  22. {memgit-0.3.1 → memgit-0.5.0}/LICENSE +0 -0
  23. {memgit-0.3.1 → memgit-0.5.0}/memgit/cloud/__init__.py +0 -0
  24. {memgit-0.3.1 → memgit-0.5.0}/memgit/cloud/client.py +0 -0
  25. {memgit-0.3.1 → memgit-0.5.0}/memgit/cloud/commands.py +0 -0
  26. {memgit-0.3.1 → memgit-0.5.0}/memgit/cloud/crypto.py +0 -0
  27. {memgit-0.3.1 → memgit-0.5.0}/memgit/cloud/state.py +0 -0
  28. {memgit-0.3.1 → memgit-0.5.0}/memgit/cloud/sync.py +0 -0
  29. {memgit-0.3.1 → memgit-0.5.0}/memgit/gitdigest.py +0 -0
  30. {memgit-0.3.1 → memgit-0.5.0}/memgit/graph.py +0 -0
  31. {memgit-0.3.1 → memgit-0.5.0}/memgit/http_server.py +0 -0
  32. {memgit-0.3.1 → memgit-0.5.0}/memgit/models.py +0 -0
  33. {memgit-0.3.1 → memgit-0.5.0}/memgit/store.py +0 -0
  34. {memgit-0.3.1 → memgit-0.5.0}/memgit/tokens.py +0 -0
  35. {memgit-0.3.1 → memgit-0.5.0}/memgit.egg-info/dependency_links.txt +0 -0
  36. {memgit-0.3.1 → memgit-0.5.0}/memgit.egg-info/entry_points.txt +0 -0
  37. {memgit-0.3.1 → memgit-0.5.0}/memgit.egg-info/requires.txt +0 -0
  38. {memgit-0.3.1 → memgit-0.5.0}/memgit.egg-info/top_level.txt +0 -0
  39. {memgit-0.3.1 → memgit-0.5.0}/setup.cfg +0 -0
  40. {memgit-0.3.1 → memgit-0.5.0}/tests/test_advanced.py +0 -0
  41. {memgit-0.3.1 → memgit-0.5.0}/tests/test_setup.py +0 -0
  42. {memgit-0.3.1 → memgit-0.5.0}/tests/test_store_repo.py +0 -0
  43. {memgit-0.3.1 → memgit-0.5.0}/tests/test_toon.py +0 -0
  44. {memgit-0.3.1 → memgit-0.5.0}/tests/test_v020.py +0 -0
  45. {memgit-0.3.1 → memgit-0.5.0}/tests/test_v030.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memgit
3
- Version: 0.3.1
3
+ Version: 0.5.0
4
4
  Summary: Git for AI memory — version-controlled context persistence across Claude, GPT, Gemini, Cursor, Windsurf, and more
5
5
  License: MIT
6
6
  Project-URL: Homepage, https://memgit.dev
@@ -44,7 +44,7 @@ Version-controlled, cross-AI context that persists, diffs, rolls back, and syncs
44
44
 
45
45
  [![PyPI](https://img.shields.io/pypi/v/memgit)](https://pypi.org/project/memgit/)
46
46
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
47
- [![Tests](https://img.shields.io/badge/tests-54%20passing-brightgreen)](tests/)
47
+ [![Tests](https://img.shields.io/badge/tests-160%20passing-brightgreen)](tests/)
48
48
 
49
49
  ---
50
50
 
@@ -212,13 +212,22 @@ memgit resume --plain # plain text, for piping into an AI context
212
212
  memgit resume --json # for tooling
213
213
  ```
214
214
 
215
- Wire it into Claude Code so every new session **starts** with this digest in context — no tool call, no judgment required:
215
+ Wire it into Claude Code so memory becomes **automatic** — no tool call, no judgment required:
216
216
 
217
217
  ```bash
218
- memgit setup hooks # installs a SessionStart hook (~/.claude/settings.json)
218
+ memgit setup hooks # installs all four hooks (~/.claude/settings.json)
219
219
  ```
220
220
 
221
- The digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one `get_memory` call away.
221
+ | Hook | What it enforces |
222
+ |---|---|
223
+ | `SessionStart` | every session opens with the resume digest in context |
224
+ | `UserPromptSubmit` | each prompt is BM25-matched against the store; relevant memories are injected (silent when nothing clears the relevance bar; never repeats within a session) — `--no-recall` to skip |
225
+ | `Stop` (guard) | a session that did real work but saved nothing gets ONE nudge to save durable facts before finishing — `--no-guard` to skip |
226
+ | `Stop` (sync) | markdown memories are checkpointed asynchronously at session end |
227
+
228
+ Why hooks and not just good tool descriptions? We measured it: across 166 real sessions, hook-injected context was delivered in **100%** of them while voluntary memory-tool calls happened in **6%**. What a hook enforces happens.
229
+
230
+ The resume digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one `get_memory` call away.
222
231
 
223
232
  ---
224
233
 
@@ -275,6 +284,16 @@ The tool descriptions teach the AI **judgment** — "does this request depend on
275
284
 
276
285
  ---
277
286
 
287
+ ## Core operating guide (v0.5.0)
288
+
289
+ A project's hardest onboarding problem isn't *what* it does — it's *how to work in it*: which skill to invoke, which command to run, which tool to reach for. That lives in a `CLAUDE.md` or a skills folder the AI host may or may not be configured to read. memgit carries it for you.
290
+
291
+ `memgit core seed` distills a compact operating guide from the project's existing skills + rule files. `memgit core sync` writes it into **every AI host's own rules surface** as a dedicated, memgit-owned file — `.claude/rules/memgit.md`, `.cursor/rules/memgit.mdc`, `.windsurf/rules/memgit.md`, `.clinerules/`, `.roo/rules/`, `.continue/rules/`, `.gemini/`, and a marker-block in Codex's `AGENTS.md`. It's **additive only** — memgit never touches your own config or content — and injected at session start, so any tool knows how to work in the project even when its native setup is missing.
292
+
293
+ And it **learns**: a sidecar usage ledger tracks which memories actually get recalled, and the most-used ones are auto-promoted as pointers into the guide over time (budget-capped, decaying, and always subordinate to the repo's own rules — it never restates or overrides them). Drifted? `memgit core heal` rebuilds it.
294
+
295
+ ---
296
+
278
297
  ## Commands
279
298
 
280
299
  ```bash
@@ -292,6 +311,13 @@ memgit search <query> # BM25 relevance search
292
311
  memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
293
312
  memgit resume # where we left off — session-start digest
294
313
  memgit merge <thread> # three-way merge a thread into the current one
314
+ memgit remove <slug> # (aliases: delete, rm, del) — mistypes get a "did you mean?"
315
+
316
+ # Core operating guide — per-project, always-on, cross-host
317
+ memgit core seed # draft a guide from this project's skills + rule files
318
+ memgit core sync # deliver it into each AI host's own rules file (additive)
319
+ memgit core show / edit # view / curate the guide
320
+ memgit core heal # self-repair a guide that has drifted
295
321
 
296
322
  # Scale & proof
297
323
  memgit squash # compress old history (archives what it collapses)
@@ -322,7 +348,8 @@ memgit setup windsurf
322
348
  memgit setup cline
323
349
  memgit setup continue
324
350
  memgit setup gemini-cli
325
- memgit setup hooks # Claude Code SessionStart hook → auto-inject resume digest
351
+ memgit setup hooks # Claude Code hooks: resume at start, per-prompt recall,
352
+ # capture guard + auto-sync at stop (--no-recall / --no-guard)
326
353
 
327
354
  # Server
328
355
  memgit serve # MCP stdio (Claude Code, Cursor, Windsurf, Cline)
@@ -405,7 +432,7 @@ git clone https://github.com/code4161/memgit.git
405
432
  cd memgit
406
433
  python -m venv .venv && source .venv/bin/activate
407
434
  pip install -e ".[dev]"
408
- pytest # 48 tests, all passing, < 1 second
435
+ pytest # 160 tests, all passing, < 3 seconds
409
436
  ```
410
437
 
411
438
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -425,6 +452,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
425
452
  - [x] Flat `memories/` directory — grep/diff/blame your memories
426
453
  - [x] D3.js graph visualization of memory relationships
427
454
  - [x] `memgit resume` + SessionStart hook — sessions start with "where we left off"
455
+ - [x] Guardrail hooks — per-prompt auto-recall + end-of-session capture guard (v0.4.0)
456
+ - [x] Core operating guide — per-project, always-on, cross-host, self-improving (v0.5.0)
428
457
  - [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
429
458
  - [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
430
459
  - [x] PyPI + Homebrew (tap) + npm published (v0.1.5)
@@ -10,7 +10,7 @@ Version-controlled, cross-AI context that persists, diffs, rolls back, and syncs
10
10
 
11
11
  [![PyPI](https://img.shields.io/pypi/v/memgit)](https://pypi.org/project/memgit/)
12
12
  [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
13
- [![Tests](https://img.shields.io/badge/tests-54%20passing-brightgreen)](tests/)
13
+ [![Tests](https://img.shields.io/badge/tests-160%20passing-brightgreen)](tests/)
14
14
 
15
15
  ---
16
16
 
@@ -178,13 +178,22 @@ memgit resume --plain # plain text, for piping into an AI context
178
178
  memgit resume --json # for tooling
179
179
  ```
180
180
 
181
- Wire it into Claude Code so every new session **starts** with this digest in context — no tool call, no judgment required:
181
+ Wire it into Claude Code so memory becomes **automatic** — no tool call, no judgment required:
182
182
 
183
183
  ```bash
184
- memgit setup hooks # installs a SessionStart hook (~/.claude/settings.json)
184
+ memgit setup hooks # installs all four hooks (~/.claude/settings.json)
185
185
  ```
186
186
 
187
- The digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one `get_memory` call away.
187
+ | Hook | What it enforces |
188
+ |---|---|
189
+ | `SessionStart` | every session opens with the resume digest in context |
190
+ | `UserPromptSubmit` | each prompt is BM25-matched against the store; relevant memories are injected (silent when nothing clears the relevance bar; never repeats within a session) — `--no-recall` to skip |
191
+ | `Stop` (guard) | a session that did real work but saved nothing gets ONE nudge to save durable facts before finishing — `--no-guard` to skip |
192
+ | `Stop` (sync) | markdown memories are checkpointed asynchronously at session end |
193
+
194
+ Why hooks and not just good tool descriptions? We measured it: across 166 real sessions, hook-injected context was delivered in **100%** of them while voluntary memory-tool calls happened in **6%**. What a hook enforces happens.
195
+
196
+ The resume digest is deliberately bounded (~350 tokens measured on a 500-memory store): rules are clipped, the critical list is capped, and full text is one `get_memory` call away.
188
197
 
189
198
  ---
190
199
 
@@ -241,6 +250,16 @@ The tool descriptions teach the AI **judgment** — "does this request depend on
241
250
 
242
251
  ---
243
252
 
253
+ ## Core operating guide (v0.5.0)
254
+
255
+ A project's hardest onboarding problem isn't *what* it does — it's *how to work in it*: which skill to invoke, which command to run, which tool to reach for. That lives in a `CLAUDE.md` or a skills folder the AI host may or may not be configured to read. memgit carries it for you.
256
+
257
+ `memgit core seed` distills a compact operating guide from the project's existing skills + rule files. `memgit core sync` writes it into **every AI host's own rules surface** as a dedicated, memgit-owned file — `.claude/rules/memgit.md`, `.cursor/rules/memgit.mdc`, `.windsurf/rules/memgit.md`, `.clinerules/`, `.roo/rules/`, `.continue/rules/`, `.gemini/`, and a marker-block in Codex's `AGENTS.md`. It's **additive only** — memgit never touches your own config or content — and injected at session start, so any tool knows how to work in the project even when its native setup is missing.
258
+
259
+ And it **learns**: a sidecar usage ledger tracks which memories actually get recalled, and the most-used ones are auto-promoted as pointers into the guide over time (budget-capped, decaying, and always subordinate to the repo's own rules — it never restates or overrides them). Drifted? `memgit core heal` rebuilds it.
260
+
261
+ ---
262
+
244
263
  ## Commands
245
264
 
246
265
  ```bash
@@ -258,6 +277,13 @@ memgit search <query> # BM25 relevance search
258
277
  memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
259
278
  memgit resume # where we left off — session-start digest
260
279
  memgit merge <thread> # three-way merge a thread into the current one
280
+ memgit remove <slug> # (aliases: delete, rm, del) — mistypes get a "did you mean?"
281
+
282
+ # Core operating guide — per-project, always-on, cross-host
283
+ memgit core seed # draft a guide from this project's skills + rule files
284
+ memgit core sync # deliver it into each AI host's own rules file (additive)
285
+ memgit core show / edit # view / curate the guide
286
+ memgit core heal # self-repair a guide that has drifted
261
287
 
262
288
  # Scale & proof
263
289
  memgit squash # compress old history (archives what it collapses)
@@ -288,7 +314,8 @@ memgit setup windsurf
288
314
  memgit setup cline
289
315
  memgit setup continue
290
316
  memgit setup gemini-cli
291
- memgit setup hooks # Claude Code SessionStart hook → auto-inject resume digest
317
+ memgit setup hooks # Claude Code hooks: resume at start, per-prompt recall,
318
+ # capture guard + auto-sync at stop (--no-recall / --no-guard)
292
319
 
293
320
  # Server
294
321
  memgit serve # MCP stdio (Claude Code, Cursor, Windsurf, Cline)
@@ -371,7 +398,7 @@ git clone https://github.com/code4161/memgit.git
371
398
  cd memgit
372
399
  python -m venv .venv && source .venv/bin/activate
373
400
  pip install -e ".[dev]"
374
- pytest # 48 tests, all passing, < 1 second
401
+ pytest # 160 tests, all passing, < 3 seconds
375
402
  ```
376
403
 
377
404
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -391,6 +418,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
391
418
  - [x] Flat `memories/` directory — grep/diff/blame your memories
392
419
  - [x] D3.js graph visualization of memory relationships
393
420
  - [x] `memgit resume` + SessionStart hook — sessions start with "where we left off"
421
+ - [x] Guardrail hooks — per-prompt auto-recall + end-of-session capture guard (v0.4.0)
422
+ - [x] Core operating guide — per-project, always-on, cross-host, self-improving (v0.5.0)
394
423
  - [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
395
424
  - [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
396
425
  - [x] PyPI + Homebrew (tap) + npm published (v0.1.5)
@@ -1,3 +1,3 @@
1
1
  """memgit — git for AI memory."""
2
2
 
3
- __version__ = "0.3.1"
3
+ __version__ = "0.5.0"