Repository navigation
feat: add one operations surface over the memory core - #13
Merged
Merged
Conversation
hermes_memory.persistent.PersistentMemory gathers the memory's operations behind one class, so every integration (MCP, agent plugins, HTTP) exposes the same memory instead of a flat subset: 1. read an exact version through current authority, with the reason and a reader state when it is refused; 2. search current, admissible versions (validity windows checked now, preconditions, kinds), rebuilding a stale index once; 3. remember a new source; 4. derive an artifact from exact parent versions (derives, indexes, cites); 5. correct with compare-and-swap, keeping metadata and parents; 6. explain parents, upstream graph, versions and dependents, metadata only; 7. plan a withdrawal, then withdraw: a source is revoked, a derived artifact is invalidated, and everything derived from it is blocked; 8. learn a lesson from a task trace and its feedback: both stay raw provenance outside search, the lesson is derived from them, and withdrawing either blocks it; 9. an exposure ledger that tells a session, once, which versions it was shown that are withdrawn, invalidated or superseded. core.py is unchanged (sha256 80c55792...); the surface relies on the pin TypedMemory already enforces. The search index and ledger.db are sidecars and never decide what may be read. 33 new unittest methods, 199 for the memory package. Thirteen mutations of the surface were each caught by the suite. check_distributions.py passes all four installed suites on Python 3.11 and 3.12 (Linux, official python Docker images). docs/OPERATIONS.md and OPERATIONS.fr.md document the surface; README links it and updates the public test count; PROVENANCE.json records the new and changed files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The Hermes Agent provider (#11) and the remote MCP endpoint (#12) each talk to the core on their own and only expose flat sources: remember, search, withdraw. Derived artifacts, exact parents, corrections, cascade and lessons stay out of reach. This PR adds the one class every integration should go through, so they all expose the whole memory.
What
hermes_memory.persistent.PersistentMemory, one workspace of one store:readsearchrememberderives,indexes,cites)derivecorrectexplainplan_withdrawal,withdrawlearnrecord_exposure,notices,exposure_reportcore.pyis unchanged (80c55792...). The surface relies on the hash pinTypedMemoryalready enforces.index.dbandledger.dbare sidecars: deleting them loses notices, never safety.docs/OPERATIONS.mdanddocs/OPERATIONS.fr.md; README links them and updates the public test count;PROVENANCE.jsonrecords the new and changed files.Checks
citesby default, no validity check, metadata dropped on correction): each one turns the suite red.scripts/check_distributions.py: four installed suites passed (wheel and rebuilt sdist, memory 199 and registry 49), test-source parity true, on Python 3.11 and 3.12 (Linux, official python Docker images). Hosted CI minutes are exhausted until 3 December.Next
Step 2 puts a full stdio MCP server on this surface; step 3 moves #11 and #12 onto it and adds a Qdrant projection. #11 and #12 stay open until then.