

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# memory-core - Harness-Neutral Agent Memory Engine23## OVERVIEW45`@oh-my-opencode/memory-core` owns the shared memory domain used by harness6adapters: a git-backed markdown MemFS, atomic memory tools, prompt compilation,7reflection scheduling, transcript search, synchronization, and seed content.8The public API is the barrel at `src/index.ts`.910## ANATOMY1112| Directory | Responsibility |13|-----------|----------------|14| `src/git/` | Git command boundary, clean-tree checks, commits, merges, remotes, and typed git errors. |15| `src/identity/` | Memory identity resolution and the `OMO_MEMORY_HOME` directory layout. |16| `src/locks/` | Cross-process locks for memory writes, reflection scheduling, and transcript state. |17| `src/memfs/` | Memory-path validation, markdown frontmatter parsing, and hook-script installation. |18| `src/tools/` | `memory` and `memory_apply_patch` operations, patch parsing, typed tool errors, and auto-commit behavior. |19| `src/journal/` | Per-conversation transcript cursors, reflection snapshots, and durable journal state. |20| `src/reflection/` | Trigger evaluation, run reservation, worktree execution, completion validation, and merge outcomes. |21| `src/compile/` | Compile committed memory revisions into marked system-prompt blocks and cache them by template hash. |22| `src/search/` | Query parsing, transcript providers, and ranked memory/session search. |23| `src/sync/` | Remote mirror synchronization and secret redaction. |24| `src/reminders/` | Reflection and memory-maintenance reminder generation. |25| `src/seeds/` | Default memory blocks and first-run repository seeding. |26| `src/concurrency/` | Subprocess fixtures for lock and multi-writer tests; not a public runtime module. |2728## CORE INVARIANTS2930- **Stay harness-neutral.** Production code and package dependencies must not31 import Senpi, Pi, OpenCode adapters, or other harness-specific packages.32 `src/harness-neutrality.test.ts` enforces this boundary.33- **Treat the memory repository as transactional state.** Write tools acquire34 the `memory-write` lock, require a clean repository, validate paths, apply one35 operation, and commit only the affected paths. Do not bypass36 `GitMemoryRepo`, lock domains, or the tool entry points.37- **Compile from committed state.** Prompt compilation may target `HEAD` or an38 explicit revision. Uncommitted working-tree content is not authoritative39 memory.40- **Preserve markdown contracts.** Memory files require YAML frontmatter with a41 non-empty `description`; `read_only: "true"` blocks mutation. Keep UTF-8,42 normalized repository-relative paths, and LF output.43- **Keep reflection transitions deterministic.** Manual triggers outrank44 compaction, which outranks step-count triggers. Only one active run and one45 merged pending reservation may exist.46- **Keep locks domain-specific.** Use `memory-write`,47 `reflection-scheduler`, or the transcript-specific lock. Do not replace them48 with one global lock or add timing-based tests.49- **Redact before external synchronization.** Remote mirror output must pass50 through the sync redaction layer; never copy secret-bearing raw logs or51 configuration into committed memory.5253## PUBLIC SURFACES5455- `runMemoryTool()` implements `create`, `str_replace`, `insert`, `delete`,56 `rename`, and `update_description`.57- `runMemoryApplyPatch()` applies multi-file Codex-style patches inside the58 memory repository.59- `GitMemoryRepo` owns repository initialization, clean checks, commits,60 revisions, merge worktrees, and remote detection.61- `evaluateTransitions()`, `reserveTransition()`, and62 `completeTransition()` form the pure reflection state machine.63- `compileMemoryBlock()` and `compileMemoryBlockAtRevision()` render the64 committed memory projection injected into a harness prompt.6566## CONSUMERS6768Harness adapters provide identity, lifecycle events, tool registration, and69sync orchestration. The Senpi adapter lives under70`packages/omo-senpi/src/components/memory/`; keep adapter-specific behavior71there rather than importing it back into this package.7273## QA7475```bash76bun test packages/memory-core/src/77bun run --cwd packages/memory-core typecheck78```7980For a focused change, run the nearest co-located `*.test.ts` first, then the81package suite. Concurrency tests must await exact state or process events with82bounded timeouts; never add fixed sleeps or retry loops.8384## ANTI-PATTERNS8586- Importing a harness package into `memory-core`.87- Writing directly to memory markdown without path validation, frontmatter88 parsing, locking, and an atomic git commit.89- Reading the dirty worktree as compiled memory.90- Mutating `read_only` blocks or accepting non-UTF-8 memory files.91- Swallowing git, lock, merge, or reflection failures.92- Testing cross-process behavior with timing luck.93
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/look-at/AGENTS.md · 68k | AGENTS.md | arch | 68/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentassets/AGENTS.md · 68k | AGENTS.md | buildteststylearch | 88/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/AGENTS.md · 68k | AGENTS.md | buildtestlint-formatstyle+3 | 83/100 | today | |
| code-yeongyu/oh-my-openagentpackages/omo-codex/plugin/components/ultrawork/AGENTS.md · 68k | AGENTS.md | buildteststylearch+1 | 77/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/tools/background-task/AGENTS.md · 68k | AGENTS.md | arch | 70/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/agents/sisyphus/AGENTS.md · 68k | AGENTS.md | arch | 56/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/ralph-loop/AGENTS.md · 68k | AGENTS.md | arch | 62/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/rules-injector/AGENTS.md · 68k | AGENTS.md | archdo-not | 69/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/omo-opencode/src/hooks/runtime-fallback/AGENTS.md · 68k | AGENTS.md | stylearchtypes | 70/100 | 13 days ago | |
| code-yeongyu/oh-my-openagent.agents/AGENTS.md · 68k | AGENTS.md | stylearchtesting-strategydatabase | 64/100 | 13 days ago | |
| code-yeongyu/oh-my-openagent.opencode/AGENTS.md · 68k | AGENTS.md | stylearchdo-not | 71/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentAGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+11 | 84/100 | today | |
| code-yeongyu/oh-my-openagentpackages/agents-md-core/AGENTS.md · 68k | AGENTS.md | archdependenciesapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/ast-grep-mcp/AGENTS.md · 68k | AGENTS.md | buildstylearchdependencies+1 | 78/100 | 7 days ago | |
| code-yeongyu/oh-my-openagentpackages/boulder-state/AGENTS.md · 68k | AGENTS.md | archapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/claude-code-compat-core/AGENTS.md · 68k | AGENTS.md | archagent-behaviour | 56/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/comment-checker-core/AGENTS.md · 68k | AGENTS.md | archdependenciesapi | 48/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/delegate-core/AGENTS.md · 68k | AGENTS.md | stylearchdependenciesapi | 60/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/git-bash-mcp/AGENTS.md · 68k | AGENTS.md | buildtestlint-formatarch+1 | 82/100 | 13 days ago | |
| code-yeongyu/oh-my-openagentpackages/hashline-core/AGENTS.md · 68k | AGENTS.md | archtypesdependenciesapi | 48/100 | 13 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/code-yeongyu-oh-my-openagent-packages-memory-core-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.