Add SetIndex method to Reader#2637
Open
openminddev wants to merge 8 commits into
Open
Conversation
Introduce Reader.SetIndex(*MemoryIndex) to replace the current in-memory index and mark the reader as ready (indexReady = true). This allows callers to inject or update the MemoryIndex instance (e.g., during initialization or testing) without directly accessing unexported fields.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a Reader.SetIndex(*MemoryIndex) method to allow callers to replace the in-memory search index and mark the reader as “ready,” enabling easier injection of a prebuilt index during initialization or testing.
Changes:
- Added
Reader.SetIndex(*MemoryIndex)to replace the internalMemoryIndex. SetIndexalso setsindexReady = trueso callers can bypassEnsureIndexwhen providing an already-initialized index.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Re-exports the memory constructors, types, and constants needed to drive the long-term memory system from outside the module (e.g. the LoCoMo benchmark harness), since Go forbids importing internal/ packages across module boundaries. The implementation stays in internal/memory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Emoji in filenames make the repo unpackageable as a Go module (go get fails with "malformed file path: invalid char"), which blocks consuming om1 as a dependency. GitHub renders templates by their frontmatter name:, so the emoji display is unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Expose the long-term memory interface as github.com/openmind/om1/memory (was memoryeval). The implementation stays in internal/memory; the façade is a pure re-export (type aliases, const aliases, one-line forwarders) and imports the internal package under an alias to avoid the package-name clash. Also moves construction wiring into internal/memory (NewIndexFromURL, NewSummarizerForRoot; NewReader reuses NewIndexFromURL) so the façade carries no behavior. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The prior commit deleted memoryeval but the new façade at repo-root memory/ was silently dropped by the unanchored .gitignore rule "memory/" (which also matches the runtime data dir). Place the public façade at pkg/memory instead, and anchor the runtime-data ignore to /memory/ so it no longer matches source packages. Public import path is github.com/openmind/om1/pkg/memory (package memory). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add anchored /memory/ and /config ignores and reformat .gitignore entries. In pkg/memory/memory.go remove redundant package and symbol comments and tighten up type/const grouping and formatting — keeping all exported aliases and forwarding constructors unchanged. No behavioral changes, just cleanup to reduce noise and improve readability.
Renamed three issue templates in .github/ISSUE_TEMPLATE to include emoji prefixes (bounty.md, bug-report.md, feature-request.md). There are no content changes—only the filenames/path were updated. Update any external links or tooling that reference the old filenames if needed.
Rename three issue template files in .github/ISSUE_TEMPLATE to remove leading emoji/unicode characters: - ".github/ISSUE_TEMPLATE/🖏-bounty.md" -> .github/ISSUE_TEMPLATE/bounty.md - ".github/ISSUE_TEMPLATE/🌀-bug-report.md" -> .github/ISSUE_TEMPLATE/bug-report.md - ".github/ISSUE_TEMPLATE/👜-feature-request.md" -> .github/ISSUE_TEMPLATE/feature-request.md Contents unchanged (similarity index 100%). This normalizes filenames to avoid encoding/compatibility issues.
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.
Introduce Reader.SetIndex(*MemoryIndex) to replace the current in-memory index and mark the reader as ready (indexReady = true). This allows callers to inject or update the MemoryIndex instance (e.g., during initialization or testing) without directly accessing unexported fields.