Skip to content

Add SetIndex method to Reader#2637

Open
openminddev wants to merge 8 commits into
mainfrom
update-memory-reader
Open

Add SetIndex method to Reader#2637
openminddev wants to merge 8 commits into
mainfrom
update-memory-reader

Conversation

@openminddev

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI review requested due to automatic review settings June 19, 2026 22:07
@openminddev openminddev requested review from a team as code owners June 19, 2026 22:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 internal MemoryIndex.
  • SetIndex also sets indexReady = true so callers can bypass EnsureIndex when providing an already-initialized index.

Comment thread internal/memory/reader.go
Comment thread internal/memory/reader.go
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 18.75000% with 13 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/memory/memory.go 0.00% 8 Missing ⚠️
internal/memory/reader.go 25.00% 3 Missing ⚠️
internal/memory/summarizer.go 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

openminddev and others added 2 commits June 19, 2026 15:21
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>
@github-actions github-actions Bot added the ci-cd CI/CD changes label Jun 19, 2026
openminddev and others added 5 commits June 19, 2026 15:42
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd CI/CD changes core go

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants