Repository navigation
feat(pi): add Topic Memory read tools - #1608
Merged
Merged
Conversation
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.
Which issue or RFC does this PR close?
Closes #1607.
This is a follow-up to the capability-alignment direction in #1338. Topic Memory query support was not explicitly enumerated as a #1338 Pi gap, so this PR does not claim to implement an item listed in that issue.
Rationale for this change
PowerContext already exposes read-only Topic Memory APIs, but Pi cannot query them through native
pc_*tools. Pi can receive Topic Memory indirectly through boundedprepare_context, but it cannot explicitly search current Topic Memory heads or inspect one exact Topic Memory revision with its direct Source evidence.Design and implementation
The implementation follows Issue #1607's design without scope expansion:
pc_topic_searchfor focused queries over current Topic Memory heads;pc_topic_getfor exact Topic Memory Artifact references returned by search;limitruntime-normalized to the Server contract range1–20with default10;registerOperationToolandinvokeScopedOperationpath;topic_memory_readcapability without changing the profile capability sets;The final design is intentionally limited to querying existing Topic Memory. It does not add Topic Memory creation, update, deletion, retirement, approval, generation, or flush controls.
Validation
pnpm test: 13 files, 89 tests passed, including real Pi CLI package loadingpnpm run typecheckuv run --frozen python -m pytest tests/test_integration_manifest.py -q: 26 passeduv run --frozen python scripts/generate_integration_manifest_docs.py --checkuv run --frozen ty checkgit diff --checkThe implementation was tested against the latest
origin/masteravailable when the branch was created.AI usage statement
OpenAI Codex with GPT-5.6 Sol was used for design, implementation, and verification. A separate OpenAI Codex task using GPT-5.6 Luna with medium reasoning performed the independent read-only review and the requested remediation loop.