Repository navigation
feat(cli)!: bm tool mirrors the bm_* MCP tools - #1943
Conversation
bm tool called the retired note tools directly, with its own flag names and renderers for their JSON shapes. Rebuild it on the 1.0 surface: one subcommand per bm_* tool (read, write, edit, move, delete, list, find, search, context, project, schema), flags named after the tool's parameters, and arguments passed through pydantic.validate_call so the shell gets the same validation an MCP client gets. Output is the tool's text result, or its JSON result with --json. The pipe-detects-JSON rule, --plain and the Rich renderers are gone from bm tool. Old subcommands and flags are removed without aliases, the same rule 1.0 applied to the MCP tool names. The renderers bm cat, bm grep and bm inspect still use move to cli/commands/output.py. The Pi integration, docs and the 1.0 migration table use the new flags. Tests that covered the old CLI's own renderers and parity bugs are removed; a signature test keeps every subcommand's flags equal to its tool's parameters. Fixes #977 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>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50dcb59af5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…t models as JSON bm_project's recent command requires a project, so bm tool project recent without --project now uses the default project; list and create still take none. bm_read returns images and documents as MCP content models, which json.dumps turned into a quoted repr; --json now dumps them with their wire names (mimeType). 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>
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
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 #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.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>
) ## Why Section 3 of the bundled manual mixed the 1.0 `bm_*` pages with 20 pages for tools no server registers. Those were retired stubs that went on to document old `bm tool` commands, plus `cloud-info`, which became `bm_project(command="info")`. `docs/manual-pages.md` still described the retired `manual` Basic Memory project. Fixes #1941. ## What changed - **Removed 20 section 3 pages.** Every remaining page names a registered tool: the `bm_*` tools, plus `bm_agent` and the ChatGPT `search`/`fetch` adapters that Cloud registers. The registry test's allowed gaps shrink to those three Cloud tools. - **Added `tools-migration(7)`.** It maps every pre-1.0 MCP tool and `bm tool` command to its 1.0 replacement, and is linked from `bm-man(3)` and `docs/1.0.md`. - **Rewrote `docs/manual-pages.md`** around the bundled pages: where they live, how to read them, page anatomy, generated sections, and adding or removing a page. - **Fixed two examples** that named removed pages: the page-reference docstring and the `chatgpt-search(3)` sample output. - **Tests:** the man-page tests use remaining pages as fixtures (`bm-search`, `bm-agent`), and the retired-pages test is gone with the pages. - The `bm_*` pages carry no CLI flag lines, so the flag rename in #1943 needed no page edits. ## Verification - `just man-regen`: all pages already match their source. - Man-page, man-resource, `bm_man` and `bm man` tests: 98 passed. `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>
## 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>
Why
bm toolstill called the retired note tools (write_note,read_note,search_notes, ...) with its own flag names (--folder,--operation,--after_date,--meta), and kept Rich and plain renderers for their old JSON shapes. An agent that knows thebm_*schemas could not write a working CLI command from them. Fixes #977.What changed
bm toolis the 1.0 surface from the shellread,write,edit,move,delete,list,find,search,context,project,schema.--directory,--note-type,--command,--since,--mode,--items,--filters).pydantic.validate_callover thebm_*function, so they get the sameAnnotatedvalidators and coercion an MCP client gets. For example,--filtersis the same JSON object, and--mode bogusfails with the same message, naming the flag. (FastMCP.call_toolneeds a live session, so it can't be used here.)--json. Refusals and invalid arguments go to stderr with exit 1.--project, commands use the configured default project.search --projects/--all-projectsandproject recentchoose their own scope.Removed, no aliases (same rule 1.0 applied to the MCP tool names)
recent,projects,workspaces,validate,infer,diff.--project-id(--projecttakes an id), automatic JSON when piped,--plain, and the Rich renderers.docs/1.0.mdhas the old-to-new CLI table.Kept
bm cat,bm grepandbm inspectuse move tocli/commands/output.pywith public names.Callers
--jsonon write. It previously relied on JSON-when-piped.projectArgssends the project id via--project.metadata-search.md,COMPACT_DISCOVERY.md,bm.1,docs/1.0.md.Tests (net -4,700 lines)
bm_*suites.tests/cli/test_tool_commands.pychecks that each subcommand's flags equal its tool's parameters, by signature introspection.test-int/cli/test_tool_commands_integration.pyruns write (stdin), edit with a checksum guard, read by section, search with--filters, move, list, delete, text output, a bad argument, and a missing default project against a real project. No patching.bm toolonly to create notes switch to the new flags.Verification
tests/cliandtest-int/cliin full: 1,248 passed, 7 skipped (before the last test additions). New tests: 16 passed.just package-check-pipasses.just fast-checkis clean.Follow-ups
bm hookandbm citobm_write/bm_search, then delete the old tool modules nothing imports (delete_note,move_note,list_directory,read_content,view_note,basic_memory_diagnostics, thenwrite_note,search).read_note,edit_notehelpers,workspaces,chatgpt_toolsandlist_memory_projectsare still imported by Cloud's hosted MCP. They go with the next Cloud re-pin.bm_*man pages' CLI lines and removes the retired stubs.🤖 Generated with Claude Code
https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8