diff --git a/.claude/commands/release/beta.md b/.claude/commands/release/beta.md index 6fd80566f..e67bf32bc 100644 --- a/.claude/commands/release/beta.md +++ b/.claude/commands/release/beta.md @@ -14,6 +14,14 @@ Create a new beta release using the automated justfile target with quality check You are an expert release manager for the Basic Memory project. When the user runs `/beta`, execute the following steps: +### Step 0: Pre-release dependency check + +While `pyproject.toml` pins a FastMCP pre-release (`fastmcp==X.Y.Zb1`), `just beta` refuses to +run: every documented install passes `--prerelease=allow`, which uv applies to basic-memory +itself, so a beta on PyPI would become the default install for stable users (#1338). Only +publish a beta in that state deliberately, with +`BASIC_MEMORY_ALLOW_BETA_WITH_PRERELEASE_DEPS=1 just beta `. + ### Step 1: Pre-flight Validation 1. Verify version format matches `v\d+\.\d+\.\d+(b\d+|rc\d+)` pattern 2. Check current git status for uncommitted changes diff --git a/.claude/commands/release/release.md b/.claude/commands/release/release.md index c34418057..eafe272ea 100644 --- a/.claude/commands/release/release.md +++ b/.claude/commands/release/release.md @@ -78,7 +78,7 @@ The GitHub Actions workflow (`.github/workflows/release.yml`) then: #### PyPI Publication 1. Verify package published at: https://pypi.org/project/basic-memory// -2. Test installation: `uv tool install basic-memory` +2. Test installation: `uv tool install basic-memory --prerelease=allow` 3. Verify installed version: `basic-memory --version` #### Homebrew Formula (Stable Releases Only) @@ -192,13 +192,13 @@ Before starting, verify: 🚀 GitHub Actions: Completed Install with pip/uv: - uv tool install basic-memory + uv tool install basic-memory --prerelease=allow Install with Homebrew: brew install basicmachines-co/basic-memory/basic-memory Users can now upgrade: - uv tool upgrade basic-memory + uv tool upgrade basic-memory --prerelease=allow brew upgrade basic-memory ``` diff --git a/.github/workflows/dev-release.yml b/.github/workflows/dev-release.yml deleted file mode 100644 index 6b47bcdbe..000000000 --- a/.github/workflows/dev-release.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Dev Release - -on: - push: - branches: [main] - workflow_dispatch: # Allow manual triggering - -env: - FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" - -jobs: - dev-release: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: write - - steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: "3.12" - - - name: Install uv - run: | - pip install uv - - - name: Compute version from git - id: check_version - run: | - # Trigger: the push of a release PR's bump commit reaches this - # workflow before the release recipe pushes the vX.Y.Z tag. - # Why: dunamai would see an untagged commit and emit a dev version, - # publishing the stable release content as a spurious dev artifact - # under the previous release line. - # Outcome: release-bump commits are recognized by the recipe's fixed - # commit subject (the same key the recipe itself uses to locate the - # commit after rebase-merge) and skipped; the Release workflow - # publishes them from the tag. - SUBJECT=$(git log -1 --pretty=%s) - if [[ "$SUBJECT" =~ ^chore:\ update\ version\ to\ .*\ release$ ]]; then - echo "is_dev=false" >> $GITHUB_OUTPUT - echo "version=" >> $GITHUB_OUTPUT - echo "Release bump commit detected ('$SUBJECT'), skipping dev release" - exit 0 - fi - # The release automation hardcodes the last stable release into - # basic_memory.__version__, so importing the source tree always - # reports that release and the old gate skipped every dev publish. - # Derive the version from the VCS state instead, exactly as - # uv-dynamic-versioning would. --no-metadata drops the +commit - # local segment, which PyPI rejects on upload. - VERSION=$(uvx dunamai from git --style pep440 --bump --no-metadata) - echo "version=$VERSION" >> $GITHUB_OUTPUT - if [[ "$VERSION" == *"dev"* ]]; then - echo "is_dev=true" >> $GITHUB_OUTPUT - echo "Dev version detected: $VERSION" - else - echo "is_dev=false" >> $GITHUB_OUTPUT - echo "Release version detected: $VERSION, skipping dev release" - fi - - - name: Build - if: steps.check_version.outputs.is_dev == 'true' - run: | - # Bypass VCS version computation in the build backend so the - # artifact carries the same metadata-free version the gate saw. - UV_DYNAMIC_VERSIONING_BYPASS="${{ steps.check_version.outputs.version }}" uv build - - # Publishes via PyPI trusted publishing (OIDC) — the PYPI_TOKEN secret no - # longer exists (stable releases attest via the release.yml trusted - # publisher). Requires a PyPI trusted-publisher registration for - # dev-release.yml on the basic-memory project. - - name: Publish dev version to PyPI - if: steps.check_version.outputs.is_dev == 'true' - uses: pypa/gh-action-pypi-publish@release/v1 - with: - skip-existing: true # Don't fail if version already exists diff --git a/AGENTS.md b/AGENTS.md index be79bfa3a..26bc50c12 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -366,11 +366,11 @@ just release v0.21.3 The recipe runs `just lint` + `just typecheck`, then updates every release manifest through `scripts/update_versions.py`: `src/basic_memory/__init__.py`, `server.json`, the root Claude marketplace, the Claude Code plugin manifest and local marketplace, the Hermes `plugin.yaml`, and the OpenClaw `package.json`. It commits as `chore: update version to X.Y.Z for vX.Y.Z release` on a `release/vX.Y.Z` branch, lands it on `main` via a rebase-merged PR, then tags the rebased commit and pushes the tag. After the tag lands, the `Release` workflow builds the Python package, publishes to PyPI, creates the GitHub release with auto-generated notes, publishes the OpenClaw npm package, and updates the Homebrew formula. The recipe finishes by printing the post-release tasks the workflow doesn't cover. -**Beta release:** `just beta v0.21.3b1` — same flow with a beta-suffixed tag. PyPI consumers install with `pip install basic-memory --pre`. +**Beta release:** `just beta v0.21.3b1` — same flow with a beta-suffixed tag. PyPI consumers install with `pip install basic-memory --pre`. While `pyproject.toml` pins a FastMCP pre-release, the recipe refuses to publish a beta: every documented install runs with `--prerelease=allow`, which uv applies to basic-memory itself, so a beta on PyPI would become the default install for stable users (#1338). Override deliberately with `BASIC_MEMORY_ALLOW_BETA_WITH_PRERELEASE_DEPS=1`. **Release dry run:** `just release-dry-run v0.21.4` previews the consolidated version update without writing files. -**Development builds:** every commit to `main` publishes a `0.21.3.dev26+468a22f`-style version to PyPI automatically via `.github/workflows/dev-release.yml`. No human action. +**Development builds are not published.** `main` commits used to publish `0.23.3.devN`-style versions to PyPI via a `dev-release.yml` workflow. That stopped with #1338: every documented install now passes `--prerelease=allow` (required by the FastMCP pre-release pin), and uv applies it to basic-memory itself, so a dev build on PyPI outranked the stable release for every fresh install. To try unreleased `main`, install from git: `uv tool install "basic-memory @ git+https://github.com/basicmachines-co/basic-memory" --prerelease=allow`. Any `.dev` versions still on PyPI from before the change must stay yanked. **Do not tag releases by hand.** A bare `git tag vX.Y.Z` skips the in-code version bump. Package metadata is still correct (uv-dynamic-versioning derives it from the git tag) but `basic-memory --version` reports the previous release, which is what happened with v0.21.2 → v0.21.3. diff --git a/README.md b/README.md index 1f4ae040b..e29a92f8c 100644 --- a/README.md +++ b/README.md @@ -81,14 +81,19 @@ Pick the path that fits you. Both run the same product on the same Markdown. - Requires Python via [`uv`](https://docs.astral.sh/uv/) ```bash -uv tool install basic-memory +uv tool install basic-memory --prerelease=allow ``` +`--prerelease=allow` is required: Basic Memory 0.23 depends on a FastMCP 4 +pre-release, and `uv` only accepts pre-releases of transitive dependencies when +told to — without the flag it silently installs an older release. The same flag +goes on every `uvx` / `uv tool upgrade` command below. + For Postgres deployments that store semantic vectors in Milvus, install the first-party optional extra instead: ```bash -uv tool install "basic-memory[milvus]" +uv tool install "basic-memory[milvus]" --prerelease=allow ``` [**Configure your client ↓**](#connect-your-ai-client) @@ -276,7 +281,7 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`: "mcpServers": { "basic-memory": { "command": "uvx", - "args": ["basic-memory", "mcp"] + "args": ["--prerelease=allow", "basic-memory", "mcp"] } } } @@ -290,7 +295,7 @@ Restart Claude Desktop. Notes live in `~/basic-memory` by default. ### Claude Code ```bash -claude mcp add basic-memory -- uvx basic-memory mcp +claude mcp add basic-memory -- uvx --prerelease=allow basic-memory mcp ``` For the full memory bridge — session briefings, pre-compaction checkpoints, and @@ -304,7 +309,7 @@ Add to `~/.codex/config.toml`: ```toml [mcp_servers.basic-memory] command = "uvx" -args = ["basic-memory", "mcp"] +args = ["--prerelease=allow", "basic-memory", "mcp"] ``` Codex can keep its default MCP approval behavior, or you can pre-approve eligible @@ -313,7 +318,7 @@ Basic Memory tools by adding this server-scoped setting to the same table: ```toml [mcp_servers.basic-memory] command = "uvx" -args = ["basic-memory", "mcp"] +args = ["--prerelease=allow", "basic-memory", "mcp"] default_tools_approval_mode = "approve" ``` @@ -332,7 +337,7 @@ Add to `.cursor/mcp.json` (project) or `~/.cursor/mcp.json` (global): "mcpServers": { "basic-memory": { "command": "uvx", - "args": ["basic-memory", "mcp"] + "args": ["--prerelease=allow", "basic-memory", "mcp"] } } } @@ -348,7 +353,7 @@ Add to your User Settings (JSON): "servers": { "basic-memory": { "command": "uvx", - "args": ["basic-memory", "mcp"] + "args": ["--prerelease=allow", "basic-memory", "mcp"] } } } diff --git a/SECURITY.md b/SECURITY.md index ac6e7aeb5..127696afe 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -46,7 +46,7 @@ explicit arguments: "mcpServers": { "basic-memory": { "command": "uvx", - "args": ["basic-memory", "mcp"] + "args": ["--prerelease=allow", "basic-memory", "mcp"] } } } diff --git a/integrations/hermes/README.md b/integrations/hermes/README.md index 85a9bef82..311a5fffe 100644 --- a/integrations/hermes/README.md +++ b/integrations/hermes/README.md @@ -26,7 +26,7 @@ memory: If you run the gateway, restart it (`hermes gateway restart`). Done. -The plugin self-installs the `basic-memory` CLI on first init via `uv tool install basic-memory` (one-time ~10s pause if it isn't already present). The bm binary lands at `~/.local/bin/bm` — the same location a manual `uv tool install basic-memory` would produce, so a later manual install or upgrade is a no-op rather than a second install. +The plugin self-installs the `basic-memory` CLI on first init via `uv tool install basic-memory --prerelease=allow` (one-time ~10s pause if it isn't already present). The bm binary lands at `~/.local/bin/bm` — the same location a manual `uv tool install basic-memory` would produce, so a later manual install or upgrade is a no-op rather than a second install. ### Prerequisites diff --git a/integrations/hermes/__init__.py b/integrations/hermes/__init__.py index bd16a78b2..96fb5e0fc 100644 --- a/integrations/hermes/__init__.py +++ b/integrations/hermes/__init__.py @@ -362,7 +362,8 @@ def _install_bm_via_uv(timeout: float = 180.0) -> str | None: Bootstrap-install basic-memory via `uv tool install`. Idempotent — re-runs are no-ops when the tool is already installed, so this - converges with later manual `uv tool install basic-memory` calls and avoids + converges with later manual `uv tool install basic-memory --prerelease=allow` + calls and avoids the two-installations-sharing-one-config-dir foot-gun. Returns the resolved bm path on success, or None if uv is unavailable or @@ -373,20 +374,24 @@ def _install_bm_via_uv(timeout: float = 180.0) -> str | None: return None try: result = subprocess.run( - [uv, "tool", "install", "basic-memory", "--quiet"], + # basic-memory pins a FastMCP pre-release; without this flag uv + # silently installs the last release that had none (#1338). + [uv, "tool", "install", "basic-memory", "--prerelease=allow", "--quiet"], check=False, capture_output=True, timeout=timeout, env=_clean_child_env(), ) except Exception as e: - logger.warning("basic-memory: `uv tool install basic-memory` failed: %s", e) + logger.warning( + "basic-memory: `uv tool install basic-memory --prerelease=allow` failed: %s", e + ) return None if result.returncode != 0: # uv prints to stderr; capture the tail so the operator can debug. stderr_tail = (result.stderr or b"").decode("utf-8", errors="replace")[-400:] logger.warning( - "basic-memory: `uv tool install basic-memory` exited %s: %s", + "basic-memory: `uv tool install basic-memory --prerelease=allow` exited %s: %s", result.returncode, stderr_tail.strip(), ) @@ -924,7 +929,7 @@ def initialize(self, session_id: str, **kwargs: Any) -> None: if _install_bm_via_uv() is None: logger.error( "basic-memory: auto-install via uv failed. Run " - "`uv tool install basic-memory` manually to debug. " + "`uv tool install basic-memory --prerelease=allow` manually to debug. " "Provider will not initialize." ) return diff --git a/integrations/hermes/tests/test_provider.py b/integrations/hermes/tests/test_provider.py index 39d78a282..7fe0ccc43 100644 --- a/integrations/hermes/tests/test_provider.py +++ b/integrations/hermes/tests/test_provider.py @@ -412,7 +412,7 @@ def _fake_run(argv, **kwargs): assert len(calls) == 1 argv = calls[0][0] assert argv[0] == "/fake/uv" - assert argv[1:] == ["tool", "install", "basic-memory", "--quiet"] + assert argv[1:] == ["tool", "install", "basic-memory", "--prerelease=allow", "--quiet"] def test_install_bm_via_uv_failed_returncode(bm, monkeypatch): diff --git a/integrations/openclaw/README.md b/integrations/openclaw/README.md index 75cff7f85..d7f28cef8 100644 --- a/integrations/openclaw/README.md +++ b/integrations/openclaw/README.md @@ -253,7 +253,7 @@ Cloud extends local-first — still plain Markdown, still yours. [Start a free t ## Troubleshooting -**`bm` not found** — Install uv, then restart the gateway. Or install manually: `uv tool install basic-memory` +**`bm` not found** — Install uv, then restart the gateway. Or install manually: `uv tool install basic-memory --prerelease=allow` (the flag is required — basic-memory depends on a FastMCP pre-release, and without it uv silently installs an older release) **Search returns nothing** — Check that Basic Memory connected (look for `connected to BM` in logs). Verify files exist in the project directory. diff --git a/integrations/openclaw/SECURITY.md b/integrations/openclaw/SECURITY.md index 558e14b40..b0da0bd2c 100644 --- a/integrations/openclaw/SECURITY.md +++ b/integrations/openclaw/SECURITY.md @@ -7,7 +7,8 @@ On first startup, this plugin checks whether the `bm` (Basic Memory) CLI is avai ### What happens 1. The plugin checks if `bm` exists on `PATH` -2. If missing, it executes `uv tool install basic-memory --force` +2. If missing, it executes `uv tool install basic-memory --prerelease=allow --force` + (the flag is needed because basic-memory depends on a FastMCP pre-release) 3. This installs the Basic Memory CLI into uv's managed tool directory (`~/.local/bin/bm` on most systems) ### What this means @@ -22,7 +23,7 @@ On first startup, this plugin checks whether the `bm` (Basic Memory) CLI is avai You can install Basic Memory yourself before enabling the plugin: ```bash -uv tool install basic-memory +uv tool install basic-memory --prerelease=allow ``` Or with pip: diff --git a/integrations/openclaw/index.ts b/integrations/openclaw/index.ts index 3eb0d243f..cb5cfe045 100644 --- a/integrations/openclaw/index.ts +++ b/integrations/openclaw/index.ts @@ -103,9 +103,17 @@ export default definePluginEntry({ log.info( "installing basic-memory via uv (this may take a minute)...", ) + // basic-memory pins a FastMCP pre-release; without this flag uv + // silently installs the last release that had none (#1338). const result = execFileSync( "uv", - ["tool", "install", "basic-memory", "--force"], + [ + "tool", + "install", + "basic-memory", + "--prerelease=allow", + "--force", + ], { encoding: "utf-8", timeout: 120_000, diff --git a/integrations/openclaw/scripts/setup-bm.sh b/integrations/openclaw/scripts/setup-bm.sh index c7b20f4e3..d128faa97 100755 --- a/integrations/openclaw/scripts/setup-bm.sh +++ b/integrations/openclaw/scripts/setup-bm.sh @@ -16,14 +16,17 @@ if ! command -v uv >/dev/null 2>&1; then fi # ── install basic-memory ──────────────────────────────── +# basic-memory pins a FastMCP pre-release; without --prerelease=allow uv +# silently installs the last release that had none (#1338). if [[ -n "${BM_REF}" ]]; then echo "Installing basic-memory from ${BM_REPO}@${BM_REF} ..." uv tool install \ "basic-memory @ git+${BM_REPO}@${BM_REF}" \ + --prerelease=allow \ --force else echo "Installing latest basic-memory from PyPI ..." - uv tool install basic-memory --force + uv tool install basic-memory --prerelease=allow --force fi # ── verify ──────────────────────────────────────────────────────── diff --git a/justfile b/justfile index c537bd4c7..424fb1132 100644 --- a/justfile +++ b/justfile @@ -796,6 +796,19 @@ beta version: exit 1 fi + # Trigger: pyproject pins a FastMCP pre-release (fastmcp==X.Y.Zb1). + # Why: while that pin exists every documented install/upgrade passes + # --prerelease=allow, and uv applies it to basic-memory itself, so a + # beta on PyPI would become the default install for stable users (#1338). + # Outcome: refuse the beta unless explicitly overridden. + if grep -Eq '"fastmcp==[0-9.]+(a|b|rc)[0-9]+"' pyproject.toml \ + && [[ "${BASIC_MEMORY_ALLOW_BETA_WITH_PRERELEASE_DEPS:-}" != "1" ]]; then + echo "❌ pyproject.toml pins a FastMCP pre-release. Stable installs run with" + echo " --prerelease=allow, so this beta would be picked up by every fresh install." + echo " Set BASIC_MEMORY_ALLOW_BETA_WITH_PRERELEASE_DEPS=1 to publish anyway." + exit 1 + fi + # Check if tag already exists if git tag -l "{{version}}" | grep -q "{{version}}"; then echo "❌ Tag {{version}} already exists" diff --git a/llms-install.md b/llms-install.md index 31e4b1e8f..7b76caf28 100644 --- a/llms-install.md +++ b/llms-install.md @@ -10,8 +10,10 @@ steps in order. Use one of the following package managers to install: ```bash -# Install with uv (recommended) -uv tool install basic-memory +# Install with uv (recommended). --prerelease=allow is required: basic-memory +# depends on a FastMCP pre-release, and without the flag uv silently installs +# an older release. +uv tool install basic-memory --prerelease=allow # Or with pip pip install basic-memory @@ -27,6 +29,7 @@ Add the following to your config: "basic-memory": { "command": "uvx", "args": [ + "--prerelease=allow", "basic-memory", "mcp" ] diff --git a/plugins/claude-code/docs/getting-started.md b/plugins/claude-code/docs/getting-started.md index 1aa9754d0..3dd597ae2 100644 --- a/plugins/claude-code/docs/getting-started.md +++ b/plugins/claude-code/docs/getting-started.md @@ -8,8 +8,10 @@ A ~5-minute walkthrough from zero to a working memory bridge. New to the idea? R - **Claude Code.** - **Basic Memory** (`>= 0.19.0`) installed and connected as an MCP server: ```bash - uv tool install basic-memory + uv tool install basic-memory --prerelease=allow ``` + (`--prerelease=allow` is required: Basic Memory depends on a FastMCP pre-release, + and without the flag uv silently installs an older release.) Then add it to Claude Code (`claude mcp add` or your MCP config). Confirm it's reachable — Claude should be able to call `list_memory_projects`. diff --git a/plugins/claude-code/skills/bm-setup/SKILL.md b/plugins/claude-code/skills/bm-setup/SKILL.md index dcdd86f93..43b9b9ce7 100644 --- a/plugins/claude-code/skills/bm-setup/SKILL.md +++ b/plugins/claude-code/skills/bm-setup/SKILL.md @@ -20,10 +20,12 @@ First confirm the **Basic Memory MCP server is connected** — call wired into Claude Code yet. **Stop and walk the user through it first** (everything below depends on it): -1. Install it: `uv tool install basic-memory` (or `pip install basic-memory`), - version `>= 0.19.0`. -2. Connect it: `claude mcp add basic-memory -- uvx basic-memory mcp`, then restart - the session so the MCP server loads. +1. Install it: `uv tool install basic-memory --prerelease=allow` (or + `pip install basic-memory`), version `>= 0.19.0`. The `--prerelease=allow` + flag is required with uv — Basic Memory depends on a FastMCP pre-release, and + without it uv silently installs an older release. +2. Connect it: `claude mcp add basic-memory -- uvx --prerelease=allow basic-memory mcp`, + then restart the session so the MCP server loads. Re-check `list_memory_projects` before continuing — don't start the interview until it succeeds. @@ -62,7 +64,7 @@ Ask only what you can't infer. Cover: - *Cloud project* (the user wants capture in a cloud workspace): pass the `workspace` selector (a slug from `list_workspaces`) and a cloud-style path like `/`, and create it with a **cloud-connected** MCP server. A purely - local server (`uvx basic-memory mcp`) treats the path as a local directory and + local server (`uvx --prerelease=allow basic-memory mcp`) treats the path as a local directory and fails to create it (e.g. read-only `/`). When both a local and a cloud server are connected, route creation *and* the schema seeding through the cloud one, and pin `primaryProject` to the new project's `external_id` UUID @@ -233,7 +235,7 @@ nudge — the config's presence is the signal that setup has run. Before you close, prove recall actually resolves — this catches a misnamed project, missing cloud credentials, or a ref that doesn't route, while the user is still here to fix it. Run the same structured query the SessionStart hook runs, via the CLI it -uses (`basic-memory` / `bm` / `uvx basic-memory`): +uses (`basic-memory` / `bm` / `uvx --prerelease=allow basic-memory`): - **Primary:** `… tool search-notes --type schema --page-size 10` against `primaryProject` — use `--project-id ` for a UUID, `--project ` @@ -244,7 +246,7 @@ uses (`basic-memory` / `bm` / `uvx basic-memory`): return *cleanly* — `0 results` is fine; an **error** means the ref doesn't route. - **Hook health:** run `basic-memory hook status --harness claude --project-dir ` with - the first available `basic-memory`, `bm`, or `uvx basic-memory` launcher. It + the first available `basic-memory`, `bm`, or `uvx --prerelease=allow basic-memory` launcher. It must find the intended settings and report the selected project and capture state. Record the shared inbox depth and last-flush state in the setup summary; the counts include envelopes from every supported harness. diff --git a/plugins/claude-code/skills/bm-status/SKILL.md b/plugins/claude-code/skills/bm-status/SKILL.md index fdf4b5c95..21a80c10f 100644 --- a/plugins/claude-code/skills/bm-status/SKILL.md +++ b/plugins/claude-code/skills/bm-status/SKILL.md @@ -12,7 +12,7 @@ This is a quick diagnostic — gather the facts and lay them out; don't over-inv ## Gather 1. **CLI reachable?** Run `basic-memory --version`, then `bm --version`, then - `uvx basic-memory --version`. If no launcher resolves, report the CLI status as + `uvx --prerelease=allow basic-memory --version`. If no launcher resolves, report the CLI status as unavailable and continue with MCP/config checks. The plugin hooks can still use their uv-managed environment. diff --git a/plugins/codex/.mcp.json b/plugins/codex/.mcp.json index 6e86668da..0b8929fba 100644 --- a/plugins/codex/.mcp.json +++ b/plugins/codex/.mcp.json @@ -3,6 +3,7 @@ "basic-memory": { "command": "uvx", "args": [ + "--prerelease=allow", "basic-memory", "mcp" ] diff --git a/plugins/codex/skills/bm-setup/SKILL.md b/plugins/codex/skills/bm-setup/SKILL.md index 6c0a7a939..c96019e8a 100644 --- a/plugins/codex/skills/bm-setup/SKILL.md +++ b/plugins/codex/skills/bm-setup/SKILL.md @@ -16,7 +16,8 @@ Confirm Basic Memory is reachable before changing files: 1. Prefer MCP: call `list_memory_projects`. 2. If MCP tools are not available, run `basic-memory --version` or `bm --version`. 3. If neither works, stop and tell the user to install Basic Memory and connect the - MCP server. The plugin bundles an `.mcp.json` that starts `uvx basic-memory mcp`. + MCP server. The plugin bundles an `.mcp.json` that starts + `uvx --prerelease=allow basic-memory mcp`. 4. List available projects before the interview. Include cloud/local source, workspace, qualified name, and project id when available. @@ -204,7 +205,7 @@ Before closing, prove the mapping works: setup, confirm the `Coding Session` schema is present. - Search one shared project for open decisions if shared projects were configured. - Run `basic-memory hook status --harness codex --project-dir ` (using - `bm` or `uvx basic-memory` if needed). Confirm that it finds this repo's + `bm` or `uvx --prerelease=allow basic-memory` if needed). Confirm that it finds this repo's settings, reports the selected project, session profile, repository, and intended checkpoint-prompt and capture states. Its inbox counts are shared across harnesses. diff --git a/plugins/codex/skills/bm-status/SKILL.md b/plugins/codex/skills/bm-status/SKILL.md index 1372cf5d7..92f5a7470 100644 --- a/plugins/codex/skills/bm-status/SKILL.md +++ b/plugins/codex/skills/bm-status/SKILL.md @@ -12,7 +12,7 @@ Gather a concise diagnostic. Do not over-investigate. 1. CLI reachability: - `basic-memory --version` - fallback `bm --version` - - fallback `uvx basic-memory --version` + - fallback `uvx --prerelease=allow basic-memory --version` Keep going if no launcher resolves. The plugin hook scripts can still use their uv-managed environment; report hook health as unavailable instead of diff --git a/server.json b/server.json index 80223a065..b80f44442 100644 --- a/server.json +++ b/server.json @@ -14,6 +14,12 @@ "version": "0.23.2", "runtimeHint": "uvx", "runtimeArguments": [ + { + "type": "named", + "name": "--prerelease", + "value": "allow", + "description": "basic-memory depends on a FastMCP pre-release; uv needs this to resolve it" + }, { "type": "positional", "value": "basic-memory" diff --git a/src/basic_memory/cli/auto_update.py b/src/basic_memory/cli/auto_update.py index 739457e95..0fd02e57c 100644 --- a/src/basic_memory/cli/auto_update.py +++ b/src/basic_memory/cli/auto_update.py @@ -200,7 +200,7 @@ def _check_pypi_update_available() -> tuple[bool, str]: def _manual_update_hint(source: InstallSource) -> str: """Return manager-appropriate manual update instructions.""" if source == InstallSource.UV_TOOL: - return "Run `uv tool upgrade basic-memory`." + return "Run `uv tool upgrade basic-memory --prerelease=allow`." if source == InstallSource.HOMEBREW: return "Run `brew upgrade basic-memory`." return ( @@ -397,8 +397,11 @@ def run_auto_update( ) # --- Automatic install --- + # uv refuses the FastMCP pre-release basic-memory pins unless asked; + # without the flag the upgrade silently resolves to the previous + # release that had no pre-release dependencies (#1338). command = ( - ["uv", "tool", "upgrade", PACKAGE_NAME] + ["uv", "tool", "upgrade", PACKAGE_NAME, "--prerelease=allow"] if source == InstallSource.UV_TOOL else ["brew", "upgrade", PACKAGE_NAME] ) diff --git a/src/basic_memory/cli/commands/hook.py b/src/basic_memory/cli/commands/hook.py index 2311b5dfd..679c4b636 100644 --- a/src/basic_memory/cli/commands/hook.py +++ b/src/basic_memory/cli/commands/hook.py @@ -1235,10 +1235,13 @@ def _hook_launcher() -> str: # Strip any .dev / +local / build suffix so the constraint is a clean release # floor (the shims pin the same way, bumped by update_versions). floor = basic_memory.__version__.split(".dev")[0].split("+")[0] + # basic-memory pins a FastMCP pre-release, and uv only accepts pre-releases + # of transitive dependencies when told to — without the flag a cold cache + # cannot resolve the floor at all (#1338). if shutil.which("uvx"): - return f'uvx "basic-memory>={floor}"' + return f'uvx --prerelease=allow "basic-memory>={floor}"' if shutil.which("uv"): - return f'uv tool run "basic-memory>={floor}"' + return f'uv tool run --prerelease=allow "basic-memory>={floor}"' return "basic-memory" diff --git a/tests/cli/test_auto_update.py b/tests/cli/test_auto_update.py index 65e3e2503..15f77e9ad 100644 --- a/tests/cli/test_auto_update.py +++ b/tests/cli/test_auto_update.py @@ -525,7 +525,7 @@ def _fake_run_subprocess(command, **kwargs): assert result.status == AutoUpdateStatus.UPDATED assert result.latest_version == "9.9.9" - assert calls == [["uv", "tool", "upgrade", "basic-memory"]] + assert calls == [["uv", "tool", "upgrade", "basic-memory", "--prerelease=allow"]] def test_unknown_manager_returns_manual_update_guidance(monkeypatch, tmp_path): diff --git a/tests/cli/test_hook_command.py b/tests/cli/test_hook_command.py index c6f1c2908..bb3c632ef 100644 --- a/tests/cli/test_hook_command.py +++ b/tests/cli/test_hook_command.py @@ -1496,7 +1496,7 @@ def test_install_uses_uvx_launcher_when_no_binary_on_path(monkeypatch: pytest.Mo assert result.exit_code == 0 command = _read_json(_claude_settings_path())["hooks"]["SessionStart"][0]["hooks"][0]["command"] - assert command.startswith('uvx "basic-memory>=') + assert command.startswith('uvx --prerelease=allow "basic-memory>=') assert command.endswith("hook session-start --harness claude") # remove must still recognize the uvx form via the suffix-based ownership tag. @@ -1528,7 +1528,7 @@ def test_install_uses_uv_tool_run_when_only_uv(monkeypatch: pytest.MonkeyPatch) assert result.exit_code == 0 command = _read_json(_claude_settings_path())["hooks"]["SessionStart"][0]["hooks"][0]["command"] - assert command.startswith('uv tool run "basic-memory>=') + assert command.startswith('uv tool run --prerelease=allow "basic-memory>=') assert command.endswith("hook session-start --harness claude") @@ -1547,7 +1547,7 @@ def test_install_skips_stale_basic_memory_and_uses_uvx(monkeypatch: pytest.Monke assert result.exit_code == 0 command = _read_json(_claude_settings_path())["hooks"]["SessionStart"][0]["hooks"][0]["command"] - assert command.startswith('uvx "basic-memory>=') + assert command.startswith('uvx --prerelease=allow "basic-memory>=') assert command.endswith("hook session-start --harness claude") diff --git a/tests/cli/test_update_command.py b/tests/cli/test_update_command.py index c0f36c809..269703e01 100644 --- a/tests/cli/test_update_command.py +++ b/tests/cli/test_update_command.py @@ -48,7 +48,7 @@ def test_update_command_check_only_shows_available(monkeypatch): "basic_memory.cli.commands.update.run_auto_update", lambda **kwargs: _result( AutoUpdateStatus.UPDATE_AVAILABLE, - message="Update available (latest: 9.9.9). Run `uv tool upgrade basic-memory`.", + message="Update available (latest: 9.9.9). Run `uv tool upgrade basic-memory --prerelease=allow`.", ), )