Skip to content

fix(core): prepare v0.23.1 fast-follow fixes - #1321

Merged
phernandez merged 18 commits into
mainfrom
codex/v0.23.1-fast-follow
Aug 25, 2026
Merged

fix(core): prepare v0.23.1 fast-follow fixes#1321
phernandez merged 18 commits into
mainfrom
codex/v0.23.1-fast-follow

Conversation

@phernandez

@phernandez phernandez commented Aug 25, 2026

Copy link
Copy Markdown
Member

Why

Milestone 17 has a small group of user-facing fixes that should ship and be exercised together before v0.23.1:

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

  • Drain pending note materializations before doctor verifies its API-created file, and run the just doctor recipe through the production deferred-materialization path.
  • Preload Rich's lazy Unicode width data before an in-place update and fall back to plain output if post-upgrade console rendering still fails.
  • Add the opt-in #bm:links_to [[Target]] directive, parser coverage, MCP guidance, and note-format documentation.
  • Store complete PostgreSQL note bodies in bounded, overlapping child vectors while retaining the existing title/stems vector on the parent row.
  • Add an Alembic migration that creates the child FTS table and GIN index and backfills existing content in 8,000-character chunks.
  • Add unit and real-PostgreSQL regressions for migration SQL and searchable content beyond both the former indexed window and PostgreSQL's single-tsvector size 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-check
  • uv 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 passed
  • BASIC_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 passed
  • BASIC_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 end
  • just doctor — passed in production deferred-materialization mode
  • alembic -c alembic.ini heads7f6a2b8c9d10 (head)
  • Cold just fast-test expanded 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

  • The PostgreSQL migration creates and backfills a child FTS table and GIN index. Cloud rollout should account for backfill time, write volume, and index-build locking on large tenant databases.
  • After deployment, manually reindex all Cloud tenants and verify that a marker located in the middle of a long note is returned by PostgreSQL lexical search.
  • The updater failure originated on Windows/Homebrew-adjacent in-place replacement paths that are difficult to reproduce faithfully on macOS; Windows CI is the required platform gate for this combined PR.

Closes #1301
Closes #1315
Closes #1316
Closes #1317
Closes #1320

groksrc and others added 6 commits August 24, 2026 23:42
`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>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: c1c2f25fac

ℹ️ 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>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/basic_memory/repository/postgres_search_repository.py Outdated
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 44312b54b4

ℹ️ 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".

@phernandez
phernandez merged commit 2681501 into main Aug 25, 2026
32 checks passed
@phernandez
phernandez deleted the codex/v0.23.1-fast-follow branch August 25, 2026 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment