Skip to content

fix: reuse connected engine for frontmatter reindex#906

Open
adriankae wants to merge 2 commits into
garrytan:masterfrom
adriankae:fix/pglite-reindex-frontmatter
Open

fix: reuse connected engine for frontmatter reindex#906
adriankae wants to merge 2 commits into
garrytan:masterfrom
adriankae:fix/pglite-reindex-frontmatter

Conversation

@adriankae
Copy link
Copy Markdown

@adriankae adriankae commented May 12, 2026

Summary

  • Pass the already-connected CLI engine into reindex-frontmatter instead of constructing a second, disconnected PGLite engine.
  • Make reindexFrontmatterCli own/disconnect only engines it creates itself.
  • Avoid false-positive effective_date_health warnings for empty date-like frontmatter fields.
  • Add regression coverage for CLI wiring and doctor effective-date checks.

Why

In PGLite installs, gbrain reindex-frontmatter could fail with PGLite not connected. Call connect() first. because the CLI had already initialized an engine, but reindex-frontmatter created/used its own unconnected engine path. This also made downstream Hermes installs carry a local compatibility patch across upgrades.

doctor also treated the mere presence of event_date, date, or published frontmatter keys as evidence of parseable date metadata even when the values were empty, producing noisy effective-date warnings.

Test plan

bun test test/reindex-frontmatter.test.ts
bun test test/doctor.test.ts -t "effective_date_health ignores empty frontmatter date fields"

Both pass locally.

Note: running the full test/doctor.test.ts file in this container hits pre-existing 5s timeouts in unrelated takes_weight_grid tests while fresh PGLite migrations run; the new focused tests pass.


View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Hermes added 2 commits May 12, 2026 06:06
- pass the CLI engine into reindex-frontmatter instead of creating a disconnected PGLite engine
- only disconnect engines owned by the reindex command
- ignore empty date-like frontmatter fields in doctor effective_date health
- add regression coverage for command wiring and doctor check
@adriankae adriankae marked this pull request as ready for review May 12, 2026 07:07
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