docs(engram-protocol): tighten save format — closed type table, manda…#386
Open
kecarmona wants to merge 1 commit intoGentleman-Programming:mainfrom
Open
docs(engram-protocol): tighten save format — closed type table, manda…#386kecarmona wants to merge 1 commit intoGentleman-Programming:mainfrom
kecarmona wants to merge 1 commit intoGentleman-Programming:mainfrom
Conversation
…tory topic_key, English titles
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.
🏷️ PR Type
type:docs— Documentation only📝 Summary
Tighten the Engram memory protocol so saved observations are actually findable
across sessions and projects. Upstream left
topic_keyoptional, thetypefield open-ended, and the
titlefree-form — which produced duplicates,collisions, and titles in mixed languages that broke cross-project search.
This change introduces a strict naming convention as a local override that
replaces only the
Format for mem_savesection of the upstream block. The restof the protocol (triggers, search rules, session-close, after-compaction) stays
untouched.
Key rules now enforced:
topic_keyis MANDATORY (was "recommended"), path-style<domain>/<scope>/<slug>, with a table of canonical patterns per case(SDD, bugfix, pattern, config, decision, discovery, preference, session).
titlesubject MUST be in English, even when the conversation is inanother language — search runs cross-project, English is the common
denominator. Body content stays in whatever language the conversation uses.
typeis a CLOSED table of 14 values. Legacyarchitectureis REMOVED(SDD artifacts use the dedicated phase types; non-SDD architectural
decisions go under
decision).titlefollows a fixed format:<Prefix>: <ticket-id?> <subject> — <qualifier?>,prefix bound to the type (
Bugfix:,Decision:,Pattern:,Spec:, etc.).mem_searchon the candidatetopic_keybeforemem_save. On hit →mem_update, never duplicate.contentstructure:What/Why/Where/Learned. NoTagsfield —
topic_keyplus the normalized title cover findability.The override declares its own precedence (
THIS section winsover theupstream block when they conflict) and lives outside the
gentle-ai syncmarkers, so future syncs of the upstream protocol will not overwrite it.
📂 Changes
engram-naming-override.mdtopic_key, closedtypetable, fixed title format, English subject rule,CLAUDE.md(override block)🧪 Test Plan
This PR is documentation/convention only — no Go code changes.
dedupe-safe records
<!-- gentle-ai:engram-protocol -->markers, sogentle-ai syncwill not touch ittypevalues map 1:1 to aPrefixand atopic_keypatterngo test ./...) — N/A, no code changescd e2e && ./docker-test.sh) — N/A, no code changesIf this PR is paired with validation code that enforces the rules at
mem_savetime, run the full suite there.✅ Contributor Checklist
status:approvedtype:*label to this PRdocs(engram): …)Co-Authored-Bytrailers💬 Notes for Reviewers
not mentioned (triggers, search, session-close, after-compaction) are left
untouched on purpose — please flag if you find a case where they conflict.
architecturefrom thetypetable is the mostuser-visible breaking change. Migration note is included: existing records
stay searchable via full-text; convention applies to NEW saves and to
mem_updateof old ones.titleexamples in the spec are all English on purpose — they double asthe canonical format reference.