memgit 0.4.0__tar.gz → 0.6.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 (47) hide show
  1. {memgit-0.4.0 → memgit-0.6.0}/PKG-INFO +39 -7
  2. {memgit-0.4.0 → memgit-0.6.0}/README.md +38 -6
  3. {memgit-0.4.0 → memgit-0.6.0}/memgit/__init__.py +1 -1
  4. {memgit-0.4.0 → memgit-0.6.0}/memgit/cli.py +395 -22
  5. memgit-0.6.0/memgit/delivery.py +370 -0
  6. {memgit-0.4.0 → memgit-0.6.0}/memgit/graph.py +5 -1
  7. {memgit-0.4.0 → memgit-0.6.0}/memgit/hooks.py +175 -3
  8. {memgit-0.4.0 → memgit-0.6.0}/memgit/http_server.py +13 -1
  9. {memgit-0.4.0 → memgit-0.6.0}/memgit/importer.py +1 -0
  10. memgit-0.6.0/memgit/links.py +249 -0
  11. {memgit-0.4.0 → memgit-0.6.0}/memgit/mcp_server.py +125 -24
  12. {memgit-0.4.0 → memgit-0.6.0}/memgit/repo.py +64 -2
  13. {memgit-0.4.0 → memgit-0.6.0}/memgit/toon.py +3 -2
  14. memgit-0.6.0/memgit/usage.py +73 -0
  15. {memgit-0.4.0 → memgit-0.6.0}/memgit.egg-info/PKG-INFO +39 -7
  16. {memgit-0.4.0 → memgit-0.6.0}/memgit.egg-info/SOURCES.txt +9 -1
  17. {memgit-0.4.0 → memgit-0.6.0}/pyproject.toml +1 -1
  18. memgit-0.6.0/tests/test_accrue.py +110 -0
  19. memgit-0.6.0/tests/test_aliases.py +64 -0
  20. memgit-0.6.0/tests/test_core.py +75 -0
  21. memgit-0.6.0/tests/test_delivery.py +121 -0
  22. memgit-0.6.0/tests/test_v060.py +531 -0
  23. {memgit-0.4.0 → memgit-0.6.0}/LICENSE +0 -0
  24. {memgit-0.4.0 → memgit-0.6.0}/memgit/cloud/__init__.py +0 -0
  25. {memgit-0.4.0 → memgit-0.6.0}/memgit/cloud/client.py +0 -0
  26. {memgit-0.4.0 → memgit-0.6.0}/memgit/cloud/commands.py +0 -0
  27. {memgit-0.4.0 → memgit-0.6.0}/memgit/cloud/crypto.py +0 -0
  28. {memgit-0.4.0 → memgit-0.6.0}/memgit/cloud/state.py +0 -0
  29. {memgit-0.4.0 → memgit-0.6.0}/memgit/cloud/sync.py +0 -0
  30. {memgit-0.4.0 → memgit-0.6.0}/memgit/gitdigest.py +0 -0
  31. {memgit-0.4.0 → memgit-0.6.0}/memgit/models.py +0 -0
  32. {memgit-0.4.0 → memgit-0.6.0}/memgit/project.py +0 -0
  33. {memgit-0.4.0 → memgit-0.6.0}/memgit/scorer.py +0 -0
  34. {memgit-0.4.0 → memgit-0.6.0}/memgit/store.py +0 -0
  35. {memgit-0.4.0 → memgit-0.6.0}/memgit/tokens.py +0 -0
  36. {memgit-0.4.0 → memgit-0.6.0}/memgit.egg-info/dependency_links.txt +0 -0
  37. {memgit-0.4.0 → memgit-0.6.0}/memgit.egg-info/entry_points.txt +0 -0
  38. {memgit-0.4.0 → memgit-0.6.0}/memgit.egg-info/requires.txt +0 -0
  39. {memgit-0.4.0 → memgit-0.6.0}/memgit.egg-info/top_level.txt +0 -0
  40. {memgit-0.4.0 → memgit-0.6.0}/setup.cfg +0 -0
  41. {memgit-0.4.0 → memgit-0.6.0}/tests/test_advanced.py +0 -0
  42. {memgit-0.4.0 → memgit-0.6.0}/tests/test_setup.py +0 -0
  43. {memgit-0.4.0 → memgit-0.6.0}/tests/test_store_repo.py +0 -0
  44. {memgit-0.4.0 → memgit-0.6.0}/tests/test_toon.py +0 -0
  45. {memgit-0.4.0 → memgit-0.6.0}/tests/test_v020.py +0 -0
  46. {memgit-0.4.0 → memgit-0.6.0}/tests/test_v030.py +0 -0
  47. {memgit-0.4.0 → memgit-0.6.0}/tests/test_v040.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memgit
3
- Version: 0.4.0
3
+ Version: 0.6.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-245%20passing-brightgreen)](tests/)
48
48
 
49
49
  ---
50
50
 
@@ -215,13 +215,14 @@ memgit resume --json # for tooling
215
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 all four hooks (~/.claude/settings.json)
218
+ memgit setup hooks # installs all five hooks (~/.claude/settings.json)
219
219
  ```
220
220
 
221
221
  | Hook | What it enforces |
222
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 |
223
+ | `SessionStart` | every session opens with the resume digest in context — status board, checkpoints, critical rules, memory index |
224
+ | `UserPromptSubmit` | each prompt is BM25-matched against the store; relevant memories are injected, ending with a "+N more on '<topic>'" depth hint when more exists (silent when nothing clears the relevance bar; never repeats within a session) — `--no-recall` to skip |
225
+ | `PostToolUse` | reading a file whose path matches a memory tag surfaces a one-line hint ("6 memories tagged 'x' relate to this path") — tagmap cache only, capped 3/session, `--no-ctx-recall` to skip |
225
226
  | `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
227
  | `Stop` (sync) | markdown memories are checkpointed asynchronously at session end |
227
228
 
@@ -284,13 +285,35 @@ The tool descriptions teach the AI **judgment** — "does this request depend on
284
285
 
285
286
  ---
286
287
 
288
+ ## Core operating guide (v0.5.0)
289
+
290
+ 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.
291
+
292
+ `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.
293
+
294
+ 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.
295
+
296
+ ---
297
+
298
+ ## Depth advertisement, trackers & supersession (v0.6.0)
299
+
300
+ Measured across 289 real sessions: injected recall reached ~59% of them, but only **6.8%** ever ran an active search — the injected top-3 reads as "memory consulted", so the model never learns there's a queryable store behind it. 0.6.0 makes the passive layer advertise what the active layer knows:
301
+
302
+ - **Memory index** — the resume digest ends with tag→count pairs (`8a8f4ec (6) · instagram (5)`) and the exact call to go deeper. Counts are truthful: superseded memories are excluded, and every advertised topic is guaranteed to return search results.
303
+ - **"+N more" recall hints** — when the per-prompt recall block has more on-topic memories behind it, it says so, with the one call to get them.
304
+ - **Context-triggered recall** — a `PostToolUse` hook: reading a file whose path matches a memory tag surfaces `memgit: 6 memories tagged 'x' relate to this path`. Reads only a commit-time tagmap cache (never the store), capped 3/session.
305
+ - **Trackers (`tr`)** — one memory per in-flight entity (`<entity>-status`), updated by re-saving the same slug. They render as a **status board** at the top of every session: memgit is the authority for entity status; files may lag.
306
+ - **Supersession** — a correction names what it replaces (`supersedes=[old-slug]`) instead of a "CORRECTED:" prefix. Superseded memories vanish from search/recall/resume (history preserved; `list` still shows them marked ⊘), so injected context is never stale.
307
+
308
+ ---
309
+
287
310
  ## Commands
288
311
 
289
312
  ```bash
290
313
  # Core (git-like)
291
314
  memgit init # initialize store (auto-detects best path)
292
315
  memgit onboard # bootstrap brief for an existing codebase
293
- memgit add <slug> <rule> # stage a memory (--body for full detail, --project to scope)
316
+ memgit add <slug> <rule> # stage a memory (--body detail, --project scope, --supersedes old-slug)
294
317
  memgit commit -m "message" # checkpoint current state
295
318
  memgit log # history
296
319
  memgit diff [sha1] [sha2] # what changed
@@ -301,6 +324,13 @@ memgit search <query> # BM25 relevance search
301
324
  memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
302
325
  memgit resume # where we left off — session-start digest
303
326
  memgit merge <thread> # three-way merge a thread into the current one
327
+ memgit remove <slug> # (aliases: delete, rm, del) — mistypes get a "did you mean?"
328
+
329
+ # Core operating guide — per-project, always-on, cross-host
330
+ memgit core seed # draft a guide from this project's skills + rule files
331
+ memgit core sync # deliver it into each AI host's own rules file (additive)
332
+ memgit core show / edit # view / curate the guide
333
+ memgit core heal # self-repair a guide that has drifted
304
334
 
305
335
  # Scale & proof
306
336
  memgit squash # compress old history (archives what it collapses)
@@ -415,7 +445,7 @@ git clone https://github.com/code4161/memgit.git
415
445
  cd memgit
416
446
  python -m venv .venv && source .venv/bin/activate
417
447
  pip install -e ".[dev]"
418
- pytest # 48 tests, all passing, < 1 second
448
+ pytest # 245 tests, all passing, < 5 seconds
419
449
  ```
420
450
 
421
451
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -435,6 +465,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
435
465
  - [x] Flat `memories/` directory — grep/diff/blame your memories
436
466
  - [x] D3.js graph visualization of memory relationships
437
467
  - [x] `memgit resume` + SessionStart hook — sessions start with "where we left off"
468
+ - [x] Guardrail hooks — per-prompt auto-recall + end-of-session capture guard (v0.4.0)
469
+ - [x] Core operating guide — per-project, always-on, cross-host, self-improving (v0.5.0)
438
470
  - [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
439
471
  - [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
440
472
  - [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-245%20passing-brightgreen)](tests/)
14
14
 
15
15
  ---
16
16
 
@@ -181,13 +181,14 @@ memgit resume --json # for tooling
181
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 all four hooks (~/.claude/settings.json)
184
+ memgit setup hooks # installs all five hooks (~/.claude/settings.json)
185
185
  ```
186
186
 
187
187
  | Hook | What it enforces |
188
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 |
189
+ | `SessionStart` | every session opens with the resume digest in context — status board, checkpoints, critical rules, memory index |
190
+ | `UserPromptSubmit` | each prompt is BM25-matched against the store; relevant memories are injected, ending with a "+N more on '<topic>'" depth hint when more exists (silent when nothing clears the relevance bar; never repeats within a session) — `--no-recall` to skip |
191
+ | `PostToolUse` | reading a file whose path matches a memory tag surfaces a one-line hint ("6 memories tagged 'x' relate to this path") — tagmap cache only, capped 3/session, `--no-ctx-recall` to skip |
191
192
  | `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
193
  | `Stop` (sync) | markdown memories are checkpointed asynchronously at session end |
193
194
 
@@ -250,13 +251,35 @@ The tool descriptions teach the AI **judgment** — "does this request depend on
250
251
 
251
252
  ---
252
253
 
254
+ ## Core operating guide (v0.5.0)
255
+
256
+ 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.
257
+
258
+ `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.
259
+
260
+ 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.
261
+
262
+ ---
263
+
264
+ ## Depth advertisement, trackers & supersession (v0.6.0)
265
+
266
+ Measured across 289 real sessions: injected recall reached ~59% of them, but only **6.8%** ever ran an active search — the injected top-3 reads as "memory consulted", so the model never learns there's a queryable store behind it. 0.6.0 makes the passive layer advertise what the active layer knows:
267
+
268
+ - **Memory index** — the resume digest ends with tag→count pairs (`8a8f4ec (6) · instagram (5)`) and the exact call to go deeper. Counts are truthful: superseded memories are excluded, and every advertised topic is guaranteed to return search results.
269
+ - **"+N more" recall hints** — when the per-prompt recall block has more on-topic memories behind it, it says so, with the one call to get them.
270
+ - **Context-triggered recall** — a `PostToolUse` hook: reading a file whose path matches a memory tag surfaces `memgit: 6 memories tagged 'x' relate to this path`. Reads only a commit-time tagmap cache (never the store), capped 3/session.
271
+ - **Trackers (`tr`)** — one memory per in-flight entity (`<entity>-status`), updated by re-saving the same slug. They render as a **status board** at the top of every session: memgit is the authority for entity status; files may lag.
272
+ - **Supersession** — a correction names what it replaces (`supersedes=[old-slug]`) instead of a "CORRECTED:" prefix. Superseded memories vanish from search/recall/resume (history preserved; `list` still shows them marked ⊘), so injected context is never stale.
273
+
274
+ ---
275
+
253
276
  ## Commands
254
277
 
255
278
  ```bash
256
279
  # Core (git-like)
257
280
  memgit init # initialize store (auto-detects best path)
258
281
  memgit onboard # bootstrap brief for an existing codebase
259
- memgit add <slug> <rule> # stage a memory (--body for full detail, --project to scope)
282
+ memgit add <slug> <rule> # stage a memory (--body detail, --project scope, --supersedes old-slug)
260
283
  memgit commit -m "message" # checkpoint current state
261
284
  memgit log # history
262
285
  memgit diff [sha1] [sha2] # what changed
@@ -267,6 +290,13 @@ memgit search <query> # BM25 relevance search
267
290
  memgit rollback <ref> # restore state to a checkpoint (HEAD~N or SHA)
268
291
  memgit resume # where we left off — session-start digest
269
292
  memgit merge <thread> # three-way merge a thread into the current one
293
+ memgit remove <slug> # (aliases: delete, rm, del) — mistypes get a "did you mean?"
294
+
295
+ # Core operating guide — per-project, always-on, cross-host
296
+ memgit core seed # draft a guide from this project's skills + rule files
297
+ memgit core sync # deliver it into each AI host's own rules file (additive)
298
+ memgit core show / edit # view / curate the guide
299
+ memgit core heal # self-repair a guide that has drifted
270
300
 
271
301
  # Scale & proof
272
302
  memgit squash # compress old history (archives what it collapses)
@@ -381,7 +411,7 @@ git clone https://github.com/code4161/memgit.git
381
411
  cd memgit
382
412
  python -m venv .venv && source .venv/bin/activate
383
413
  pip install -e ".[dev]"
384
- pytest # 48 tests, all passing, < 1 second
414
+ pytest # 245 tests, all passing, < 5 seconds
385
415
  ```
386
416
 
387
417
  See [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -401,6 +431,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md).
401
431
  - [x] Flat `memories/` directory — grep/diff/blame your memories
402
432
  - [x] D3.js graph visualization of memory relationships
403
433
  - [x] `memgit resume` + SessionStart hook — sessions start with "where we left off"
434
+ - [x] Guardrail hooks — per-prompt auto-recall + end-of-session capture guard (v0.4.0)
435
+ - [x] Core operating guide — per-project, always-on, cross-host, self-improving (v0.5.0)
404
436
  - [x] `memgit gc` — space reclamation (mark-and-sweep, lossless squash archive)
405
437
  - [x] Multi-agent write safety — store lock, auto-merge commits, `memgit merge`
406
438
  - [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.4.0"
3
+ __version__ = "0.6.0"