Skip to content

refactor(mcp): remove retired tool modules nothing calls - #1944

Merged
phernandez merged 1 commit into
mainfrom
refactor/remove-legacy-tool-modules
Oct 29, 2026
Merged

phernandez merged 1 commit into
mainfrom
refactor/remove-legacy-tool-modules

Conversation

@phernandez

Copy link
Copy Markdown
Member

Stacked on #1943.

Why

After #1943, bm hook and bm ci were the last callers of the retired write_note and search_notes implementations, and six retired tool modules had no callers at all.

What changed

bm hook and bm ci use the 1.0 tools

  • The session brief queries call bm_search; checkpoints and CI project updates call bm_write.
  • One project parameter carries a name, workspace/project route, or id, so split_project_ref is gone.
  • filters replaces metadata_filters and status; since replaces after_date.
  • An unmapped hook directory reads the default project, as before.
  • A refused checkpoint write arrives as a ToolError and is still reported on stderr without failing the hook.
  • _routed_project in bm ci returns the id when one is configured, and falls back to the default project.

Deleted (no importers in core or Cloud, checked against basic-memory-cloud main)

  • basic_memory_diagnostics, delete_note, list_directory, move_note, read_content, view_note, plus their re-exports, tests, contract-table entries and implementation-harness names.

Kept for now

  • write_note: about 20 test files use it to create notes, many parsing its text output. Moving them to bm_write is its own PR.
  • read_note, the edit_note helpers, workspaces, chatgpt_tools, list_memory_projects: Cloud's hosted MCP imports them. They go with the next Cloud re-pin.
  • Implementation modules the bm_* tools call (build_context, recent_activity, project_management, schema, search), and posix_tools for the shell commands.
  • Man pages for the deleted tools: removed in 1.0 manual: section 3 lists only registered tools, plus one migration page #1941.

Tests

  • bm ci: the seeding and publish tests now run against a real project. Publish moved to test-int/cli/test_ci_publish_integration.py, because the command needs the integration fixtures' shared database. Routing (id over name, workspace qualification) is tested directly on _routed_project.
  • Ported to the 1.0 tools rather than dropped: the workspace-qualified memory:// delete regression (now on bm_delete), the wiki-after-API-writes test, and the write-conflict-after-move test (now on bm_move).
  • The brief-formatting hook tests still stub the search tool; their patches now target bm_search/bm_write with the new argument names.

Verification

  • tests/mcp, tests/cli, tests/hooks, test-int/cli and test-int/mcp: 3,406 passed on the first run. The 7 failures and 22 errors were stale references to the deleted tools; all fixed, and those files rerun at 245 passed.
  • just fast-check is clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T04:18:21.821168Z 34d5909 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@phernandez
phernandez added this pull request to stack #1950 October 29, 2026 05:05
@phernandez
phernandez force-pushed the refactor/remove-legacy-tool-modules branch from 34d5909 to f957b56 Compare October 29, 2026 05:14
Base automatically changed from feat/977-bm-tool-mirrors-bm-tools to main October 29, 2026 05:26
With bm tool on the bm_* tools, bm hook and bm ci were the last callers
of the retired write_note and search_notes implementations. Move them to
bm_write and bm_search: a single project parameter carries a name, a
workspace/project route or an id, filters replace metadata_filters and
status, and since replaces after_date. A refused checkpoint write now
arrives as a ToolError and is reported on stderr as before.

Delete the modules no code in core or Cloud imports:
basic_memory_diagnostics, delete_note, list_directory, move_note,
read_content and view_note, with their tests, contract entries and
harness names. Drop split_project_ref, which only the hook used.

Tests that patched the retired tools now target bm_search and bm_write.
The bm ci seeding and publish tests run against a real project, and
routing is tested directly on _routed_project.

write_note stays for now: about 20 test files use it to create notes.
read_note, the edit_note helpers, workspaces, chatgpt_tools and
list_memory_projects stay until Cloud stops importing them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez force-pushed the refactor/remove-legacy-tool-modules branch from f957b56 to 4317c2e Compare October 29, 2026 05:26
@phernandez
phernandez merged commit 7a5bd74 into main Oct 29, 2026
51 checks passed
@phernandez
phernandez deleted the refactor/remove-legacy-tool-modules branch October 29, 2026 06:10
phernandez added a commit that referenced this pull request Oct 29, 2026
Stacked on #1944.

## Why

After #1944, nothing in core or Cloud called `write_note`. About 20 test
files still used it to create notes.

## What changed

- Test setup calls move to `bm_write`. The keyword arguments are the
same; `project_id` becomes `project`.
- Assertions that read `write_note`'s text output (`# Created note`,
`file_path: ...`) now request JSON and check fields.
- The remote-project regression (a host symlink must not be read as part
of a remote project) now covers `bm_write`, which routes through
`note_targets`.
- Deleted: `write_note.py`, its three test files, its export, contract
entries and harness name.
- Dropped: the `mcp.tool.write_note` span test. **The `bm_*` tools emit
no tool-level span**, so that telemetry is a gap in the 1.0 surface, not
just in this PR.

## Verification

- `tests/mcp`, `tests/api`, `tests/cli`, the man-page and CLI-consumer
tests, `test-int/mcp` and `test-int/cli`: 3,771 passed, 6 failed on the
first run. The 6 were assertions on `write_note`'s text format; after
the fix those files pass (72).
- `just fast-check` is clean.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
phernandez added a commit that referenced this pull request Oct 29, 2026
## Why

`just release v1.0.0` pre-flight-checks for a `## v1.0.0` heading on
`main`, so the changelog has to land first.

## What changed

`CHANGELOG.md`: the Unreleased section becomes `## v1.0.0 (2026-10-29)`.
Its existing items are kept, and the 60 or so commits since #1871 are
added:

- **Breaking:**
- the MCP surface is only `bm_*`, with the old tools deleted (#1944,
#1947, #1959, #1962–#1964)
  - `project` is required (#1934)
  - the ChatGPT adapters moved to Cloud
  - `bm tool` mirrors the tools (#1943)
  - the POSIX verbs are rebuilt and `bm tail` is removed (#1960)
  - cloud sync/bisync are removed (#1953)
  - `bm schema` project resolution (#1959)
  - LiteLLM is an optional extra
- **Features:** text-file line ranges in `bm_read`; chat imports return
their file paths.
- **Bug fixes:** including the three found in the 1.0 live test (#1971,
#1972, #1974), with contributor credits for @Flynn-Kawolsky (#1957),
@SWSAmor (#1951) and @MbappeWU (#1948).
- **Security:** the CodeRabbit deep-scan hardening batch.

I checked the entries against PR bodies rather than titles, and
corrected #1954, #1948 and #1967 to describe what they actually fixed.

The date is today; change it if the tag lands tomorrow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

Signed-off-by: phernandez <paul@basicmachines.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant