feat(sdkx): tool migration wrappers + Anthropic Memory Tool#79
Merged
Conversation
Land sdkx/tool/{knowledge,kanban,history,memory} so users can switch
imports off the deprecated sdk/{knowledge,kanban,history} tool helpers
ahead of sdk/v0.3.0. Public signatures stay identical, so the eventual
v0.3.0 cut is a `go get -u` with no source-level changes for callers.
- knowledge: full mirror (uses only public sdk/knowledge API).
- kanban: full mirror; WithKanban/KanbanFrom forward to sdk/kanban so
contexts installed on either side interoperate during the transition.
- history: type alias + delegation. The underlying tools reach into
package-private archive helpers (archiveImpl, loadManifestImpl,
SummaryDAG{store,config}) which can't be exported without growing
sdk's stable surface. The alias pins the API shape now; the impl
relocates at sdk/v0.3.0 cut.
- memory: net-new Anthropic Memory Tool (memory_20250818) wrapper over
workspace.Workspace. Single tool, command enum, mandatory /memories
prefix, str_replace ambiguity errors out, view truncation cap.
Each package ships a doc.go explaining the sdkx layering rationale and
the migration path, plus tests covering API contracts (incl. context-key
interop for kanban and the type-alias contract for history).
docs/migrations/v0.3.0.md: document the sdk↔sdkx release coordination
so users understand the two-step upgrade (import swap during v0.2.x,
then dual `go get -u` at v0.3.0 cut).
Co-authored-by: Cursor <cursoragent@cursor.com>
The first cut stripped /memories entirely when forwarding to workspace.Workspace, which dumped Memory Tool writes at the workspace root and would collide with peer subsystems (recall/, knowledge/, history/) once they migrate to fs-backed storage on the same workspace. Preserve the "memories" segment so the tool stays sandboxed in <workspace>/memories/, peer to the other subtrees. Adds: - TestSubtreeIsolation: pre-seeds recall/ and knowledge/ peer subtrees, verifies Memory Tool view doesn't leak them and writes don't disturb them. - TestViewMemoriesRoot: viewing an empty /memories root succeeds with empty entries (List ErrNotFound is tolerated). Doc.go updated to make the layout explicit, including the option to wrap with workspace.NewScopedWorkspace for defensive enforcement. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
Phase 3 of the sdkx track: lands
sdkx/tool/{knowledge,kanban,history,memory}so users can switch their imports before sdk/v0.3.0 deletes the corresponding helpers fromsdk/{knowledge,kanban,history}. Public signatures stay identical, so the v0.3.0 cut becomes a purego get -ufor callers — no source edits after the import swap.sdkx/tool/knowledgesdk/knowledgeAPI).sdkx/tool/kanbanWithKanban/KanbanFromforward tosdk/kanbanso contexts installed on either side interoperate.sdkx/tool/historyarchiveImpl,loadManifestImpl,SummaryDAG{store,config}) that can't be exported without growing sdk's stable surface. The alias pins the API shape now; the implementation relocates at the sdk/v0.3.0 cut.sdkx/tool/memorymemory_20250818) wrapper overworkspace.Workspace. Single tool, command enum, mandatory/memoriesprefix, view-byte cap, str_replace ambiguity errors, path-traversal guard.Each package ships a
doc.goexplaining the sdkx layering rationale and migration path. Tests cover:var sdk Hist.ToolDeps = sdkx.ToolDeps{});docs/migrations/v0.3.0.md: documents sdk↔sdkx release coordination — users do a one-line import swap during v0.2.x, then a pairedgo get -uat v0.3.0 cut, no other source edits.Test plan
make fmtclean across the workspacecd sdkx && go vet ./...cd sdkx && go test ./tool/... -count=1— all four packages passtype Foo XregressionNotes
[skip-tag:sdk]needed.historypackage is intentionally a thin forwarding layer in v0.2.x — see commit message and the packagedoc.gofor why path D (alias + delegation) was preferred over exporting private helpers or duplicating archive logic.Made with Cursor