fix(core): prepare v0.23.1 fast-follow fixes - #1321
Conversation
`bm update` crashed with an unhandled ModuleNotFoundError after Homebrew
replaced the running installation on disk:
ModuleNotFoundError: No module named 'rich._unicode_data.unicode17-0-0'
`_preload_lazy_console_modules` was added for exactly this failure mode,
but it only covered `rich._emoji_codes` and `typer.rich_utils`. rich also
defers its Unicode cell-width table until the first character it cannot
measure with the ASCII fast path in `_cell_len` -- and the status messages
echo captured `brew`/`uv` output, which carries curly quotes and em dashes.
That import lands after `brew upgrade` deleted the prefix we are running
from, so the message meant to report the result became a traceback and a
non-zero exit for an upgrade that had already succeeded.
Resolve the table through `rich.cells.cell_len` rather than importing a
module by name, so rich picks the version and honors UNICODE_VERSION the
same way the print path does.
Also route every update status line through `print_update_status`, which
falls back to a plain write if the console raises. The preload can only
cover the deferred imports known today; once the upgrade has succeeded, a
status line must never be what fails the command.
Fixes #1316
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112BNQpaC8AujnHc17YzS9D
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: Mike Mikemikike <mikemikimike@users.noreply.github.com> Signed-off-by: mikemikimike <13286568797@163.com> Signed-off-by: mikemikimike <13286568797@163.com>
Add regression coverage for preserving the directive in source and excluding it from observation semantics. Signed-off-by: Mike Mikemikike <mikemikimike@users.noreply.github.com> Signed-off-by: mikemikimike <13286568797@163.com> Signed-off-by: mikemikimike <13286568797@163.com>
Signed-off-by: mikemikimike <13286568797@163.com>
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6cde26b636
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa6812cea5
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5db29bf414
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a057396bd6
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 02fe554f60
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7bb5fafa1
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 608716dd5b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1a1be7c80
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0ccf2c2b7
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c38527c9e4
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
Milestone 17 has a small group of user-facing fixes that should ship and be exercised together before v0.23.1:
basic-memory doctorcould check for the API-created note before deferred materialization wrote it to disk ([BUG] basic-memory doctor always fails with "API note file missing" outside test mode #1315, bm doctor fails on 0.23.0: "API note file missing" — note materialization raises EntityNotFoundError / StaleDataError #1317).bm updatecould crash while reporting a successful in-place Homebrew upgrade after Rich's lazy Unicode table disappeared with the old installation (bm update: crash after in-place upgrade — preload misses rich's Unicode width table #1316).#bm:links_to [[Target]]form that remains readable in the source note (Add a #bm:links_to directive for ambiguous relation-shaped bullets #1301).This PR carries forward the focused contributor work from #1318 and #1306, preserving authorship and sign-offs, and combines it with the doctor and PostgreSQL fixes so the full platform matrix—especially Windows—runs against one release candidate.
What Changed
doctorverifies its API-created file, and run thejust doctorrecipe through the production deferred-materialization path.#bm:links_to [[Target]]directive, parser coverage, MCP guidance, and note-format documentation.tsvectorsize limit.Implementation Notes
The doctor fix waits on the existing materialization queue instead of introducing timing sleeps. The PostgreSQL migration is backend-gated, so SQLite remains unchanged. Full bodies are split into 8,000-character chunks with 200 characters of overlap, preventing one unbounded note from exceeding PostgreSQL's roughly 1 MB limit for a single
tsvector. The migration backfills existing search rows, and a tenant-wide Cloud reindex after rollout is acceptable as an additional consistency pass.Testing
just fast-checkuv run pytest -p pytest_mock --no-cov -q tests/cli/test_doctor_command.py tests/cli/test_auto_update.py tests/markdown/test_relation_edge_cases.py tests/test_postgres_full_content_search_migration.py— 57 passedBASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 LOGFIRE_IGNORE_NO_CONFIG=1 uv run pytest -p pytest_mock --no-cov -q tests/repository/test_postgres_search_repository.py::test_postgres_search_indexes_full_note_content— 1 passedBASIC_MEMORY_ENV=test BASIC_MEMORY_TEST_POSTGRES=1 LOGFIRE_IGNORE_NO_CONFIG=1 uv run pytest -p pytest_mock --no-cov -q tests/repository/test_postgres_search_repository.py— 24 passed; includes a 1.2 MB note with a searchable marker at the endjust doctor— passed in production deferred-materialization modealembic -c alembic.ini heads—7f6a2b8c9d10 (head)just fast-testexpanded to all 5,628 tests; stopped in the slow semantic integration matrix at 51% with no failures after the focused gates above passed. The complete OS/backend matrix is delegated to CI.Risks and Rollout
Closes #1301
Closes #1315
Closes #1316
Closes #1317
Closes #1320