Skip to content

fix(memory-pgvector): require lowercase schema and table prefix - #707

Merged
blove merged 1 commit into
mainfrom
blove/align-pgvector-identifier-validation
Sep 17, 2026
Merged

blove merged 1 commit into
mainfrom
blove/align-pgvector-identifier-validation

Conversation

@blove

@blove blove commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Two follow-ups from #699, both small and unrelated to each other. Raised together rather than as two near-empty pull requests.

1. memory-pgvector identifier validation

#699 tightened assertIdentifier in @b4run/postgres-storage to reject mixed case. @b4run/memory-pgvector kept its own near-duplicate copy on the old case-insensitive pattern, so the two Postgres-backed packages disagreed about what a valid identifier is.

The reason applies identically to both: initSchema interpolates schema and prefix into DDL unquoted, and Postgres folds an unquoted identifier to lowercase. A value like MySchema created myschema, so the configured name never named the tables the store then queried.

The copies stay separate rather than being shared. memory-pgvector depends on @b4run/memory, not on the agent-state stores, and adding a dependency edge purely to share a four-line regex would pull that package's LangGraph peers in with it. Each copy now carries a comment naming the other, so the next person to change one sees the other.

Every in-repo caller already passes lowercase (defaults are public / b4_memory; the test prefixes are base-36, which is always lowercase), so nothing in the repo changes behavior. IDENTIFIER_PATTERN is exported to match postgres-storage.

This is a behavior change for external callers, described as such in the changeset. It stays a patch: on this 0.x fixed group a minor bumps every package to 1.0.0.

2. API reference inventory test timeout

api-reference-inventory.test.ts spawned check-docs.mjs --analyze-detailed-api-references with a 60 second budget. That analysis re-parses every package's public surface and takes about 80 seconds on a developer laptop, so the test failed with ETIMEDOUT while the analysis itself reported zero failures. A red test that says nothing about the docs.

Raised to 180 seconds, sized for headroom on a loaded machine rather than just above the observed time. A genuine hang still terminates, just later. It passed in CI before this, so this is a latent flake rather than a live break.

Verification

  • @b4run/memory-pgvector unit tests, and the gated Testcontainers lane with B4_TEST_PGVECTOR=1: 94 passed, 1 skipped.
  • api-reference-inventory.test.ts, which previously failed on this machine: 252 passed.
  • node scripts/check-docs.mjs passes. The schema and tablePrefix option docs were updated at the source, and the API reference page kept in sync with them, which the contract fingerprint enforces.
  • Lint and typecheck clean for both touched packages.

No release.

🤖 Generated with Claude Code

Two follow-ups from #699.

memory-pgvector kept its own copy of assertIdentifier, still case-insensitive,
while postgres-storage tightened to lowercase. Both interpolate the value into
DDL unquoted and Postgres folds an unquoted identifier to lowercase, so
`MySchema` created `myschema` and never named the tables the store then
queried. The two packages had come to disagree about what a valid identifier
is. The copies stay separate, because memory-pgvector depends on @b4run/memory
rather than on the agent-state stores and a dependency edge purely to share
four lines would drag that package's LangGraph peers in with it; each now
carries a comment pointing at the other.

The api-reference inventory test allowed 60s for a child analysis that takes
~80s on a laptop, so it failed with ETIMEDOUT while reporting zero analysis
failures — red, and saying nothing about the docs. Raised to 180s, sized for a
loaded machine rather than close to the observed time.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@blove
blove enabled auto-merge (squash) September 17, 2026 18:09
@vercel

vercel Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
b4-run Ready Ready Preview Sep 17, 2026 6:10pm UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated approval: this PR received an intelligent (AI) code review. See the review comments on this PR.

@blove
blove merged commit ebe6921 into main Sep 17, 2026
30 of 31 checks passed
@blove
blove deleted the blove/align-pgvector-identifier-validation branch September 17, 2026 19:05

This branch was successfully deployed

1 active and 1 inactive deployments
vercel-preview — 3ecb8c10 Deployed Sep 17, 2026 by blove via vercel-native #1987
Preview — 3ecb8c10 Deployed Sep 17, 2026 by vercel[bot]
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