fleet-memory/hindsight-api/hindsight_api/engine
Jerry Henley e99ee0f243
Add Supabase tenant extension as built-in (#267)
Move the Supabase tenant extension into the hindsight-api package so users
can enable it with just an environment variable — no file copying or Docker
image modifications needed.

Key improvements over the original submission:
- JWKS-based local JWT verification (no network call per request) with
  automatic fallback to /auth/v1/user for legacy HS256 projects
- Service key is now optional (only needed for HS256 or health checks)
- UUID validation on user IDs before schema name construction
- Schema prefix validation against Postgres identifier rules
- Key rotation handling with automatic JWKS cache refresh
- Proper logging via Python logging module
- Tenant extension lifecycle hooks (on_startup/on_shutdown) wired into
  the server lifespan
- Public tenant_extension property on MemoryEngine
- 54 unit tests covering both verification modes, cache behavior, error
  paths, and the extension loader
- README updated to reflect JWKS-first architecture

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-09 10:16:47 +01:00
..
consolidation feat: support markdown in reflect and mental models (#307) 2026-02-06 10:49:13 +01:00
directives feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
mental_models feat: revisit mental models, directives and reflections (#179) 2026-01-22 17:13:16 +01:00
providers doc: update claude-code usage terms (#315) 2026-02-06 16:53:12 +01:00
reflect fix(ci): resolve flaky test failures in api tests (#311) 2026-02-06 13:56:59 +01:00
retain doc: update claude-code usage terms (#315) 2026-02-06 16:53:12 +01:00
search fix(ci): resolve flaky test failures in api tests (#311) 2026-02-06 13:56:59 +01:00
__init__.py feat: extensions (#54) 2025-12-22 11:05:23 +01:00
cross_encoder.py fix: hide hf logging (#295) 2026-02-04 13:12:30 +01:00
db_budget.py fix: batch queries on recall (#149) 2026-01-13 13:20:22 +01:00
db_utils.py misc: performance improvements (#140) 2026-01-09 14:47:20 +01:00
embeddings.py fix: hide hf logging (#295) 2026-02-04 13:12:30 +01:00
entity_resolver.py fix: misc perf improvements (#133) 2026-01-08 22:49:04 +01:00
interface.py chore: remove dead code (#245) 2026-01-30 09:16:32 +01:00
llm_interface.py feat: support for codex and claude-code as llm (#276) 2026-02-02 12:54:44 +01:00
llm_wrapper.py feat: support for codex and claude-code as llm (#276) 2026-02-02 12:54:44 +01:00
memory_engine.py Add Supabase tenant extension as built-in (#267) 2026-02-09 10:16:47 +01:00
query_analyzer.py fix: improve mpfp retrieval (#146) 2026-01-12 18:58:05 +01:00
response_models.py chore: remove dead code (#245) 2026-01-30 09:16:32 +01:00
task_backend.py fix: retain async fails if timestamp is set (#251) 2026-01-30 13:04:33 +01:00
utils.py chore: remove dead code (#245) 2026-01-30 09:16:32 +01:00