agnes-the-ai-analyst/docs
ZdenekSrotyr aa5921da67
release: 0.47.0 — source-agnostic catalog metadata + cache discipline (#223)
## Summary

- Catalog enrichment for `query_mode='remote'` rows: `rows`, `size_bytes`, `partition_by`, `clustered_by` per table (BQ + Keboola providers).
- `/api/v2/schema/{id}` cache miss: 2 BQ jobs → 1 (-50%) via shared `fetch_bq_columns_full`.
- All four catalog/schema/sample/metadata caches flush on registry change; single-row re-warm scheduled.
- Automatic cache warmup at server startup (bounded concurrency, opt-out via `AGNES_SKIP_CACHE_WARMUP=1`).
- SSE-driven freshness toolbar on `/admin/tables` with progress bar, log, and per-row badge.
- New admin doc `docs/admin/query-modes.md` — single source of truth on `local` / `remote` / `materialized` choice.

Closes #155.
Closes #156.

## Test plan

- [x] 65+ targeted tests pass across 11 new test modules + 3 modified ones.
- [x] No DB migration; no wire-break; `MIN_COMPAT_CLI_VERSION` unchanged.
- [ ] Reviewer: register a remote BQ table via `/admin/tables`, observe the toolbar populates within ~2 s and the per-row badge transitions warming → fresh.
- [ ] Reviewer: trigger `Re-warm all`, verify SSE log scrolls and `cacheWarmupBar` progresses.
- [ ] Reviewer: edit a registered row's bucket, verify `agnes schema <id>` returns updated columns immediately (no 1-hour staleness).
- [ ] Reviewer: confirm `agnes admin register-table --query-mode remote` prints the new IAM-smoke-check hint.

## Notable design decisions

- BigQuery `INFORMATION_SCHEMA.TABLE_STORAGE` is the only valid scope for size+rows (verified live 2026-05-07; dataset-scoped doesn't exist). Region resolved from `instance.yaml.data_source.bigquery.location` → `bq.client().get_dataset(...)` → fall back to legacy `__TABLES__`.
- VIEW handling: TABLE_STORAGE returns no rows for views, fall through to `__TABLES__` (also empty) → `TableMetadata(rows=None, size_bytes=None, partition_by=..., clustered_by=...)`. Null size signals analyst Claude to apply existing CLAUDE.md guidance.
- `size_bytes` is `active_logical_bytes + long_term_logical_bytes` — full BQ scan reads both; reporting only active undercounts aged partitioned tables.
- Source-agnostic provider seam: per-source `connectors/<source>/metadata.py:fetch(MetadataRequest)`; dispatcher in `app/api/v2_catalog.py:_metadata_provider_for` lazily imports per source_type so a Keboola-only deployment doesn't pay the BQ-extension import cost.
- Warmup non-blocking: FastAPI `lifespan` schedules `asyncio.create_task(_warm_catalog_caches_bg)` before `yield`. Per-row failures isolated.

## Out of scope

- Profile / column histograms / dimension cardinality for remote tables (separate issue).
- Onboarding nudge ("you have 0 remote tables, consider registering some BQ ones") — separate UX call.
- Provider plug-in registration via entry-points (the dispatch table is a hardcoded if-tree today; one line per future source).

## Release

Bumps `pyproject.toml` 0.46.1 → 0.47.0 (main shipped 0.46.0 + 0.46.1 during this PR — see commit `d98976ec`). New CHANGELOG section under `## [0.47.0] — 2026-05-07`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/keboola/agnes-the-ai-analyst/pull/223" target="_blank">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review">
  </picture>
</a>
<!-- devin-review-badge-end -->
2026-05-07 18:33:55 +02:00
..
admin release: 0.47.0 — source-agnostic catalog metadata + cache discipline (#223) 2026-05-07 18:33:55 +02:00
future docs: update references to deleted files 2026-04-09 17:15:19 +02:00
metrics chore(docs): replace stale da verbs and vendor-specific install paths 2026-05-04 21:22:19 +02:00
setup release: 0.46.4 — detach SessionEnd push so it survives claude -p SIGTERM (#222) 2026-05-07 17:59:27 +02:00
superpowers release: 0.47.0 — source-agnostic catalog metadata + cache discipline (#223) 2026-05-07 18:33:55 +02:00
testing docs(testing): add coverage honesty + prerequisites to E2E plan 2026-05-04 19:59:47 +02:00
ADR-corporate-memory-v1.md feat(memory): corporate memory v1+v1.5 + 0.15.0 (#72) 2026-04-29 07:16:22 +02:00
agent-setup-prompt.md fix(api): align PUT validation autoescape with runtime (False); docs match 2026-05-03 21:30:24 +02:00
agent-workspace-prompt.md chore(docs): replace stale da verbs and vendor-specific install paths 2026-05-04 21:22:19 +02:00
architecture.md fix(compose): drop corporate-memory + session-collector services (#176) 2026-05-04 23:59:44 +02:00
auth-google-oauth.md refactor(docs): sweep DA_* env vars + surviving da-verbs in docs/*.md (Task 0.5 fix) 2026-05-04 16:43:15 +02:00
auth-groups.md refactor(docs): sweep DA_* env vars + surviving da-verbs in docs/*.md (Task 0.5 fix) 2026-05-04 16:43:15 +02:00
auto-install.md chore: clean stale docs — rewrite architecture.md, remove old plans 2026-04-09 09:06:13 +02:00
CONFIGURATION.md docs: update stale v1 docs to v2 Docker/FastAPI/DuckDB architecture 2026-04-09 18:44:25 +02:00
corporate-memory-governance.md Add Corporate Memory governance — Phase 1 (data model + admin API) 2026-03-23 19:15:33 +01:00
DATA_SOURCES.md fix(post-merge): clean up stale da verbs introduced via #174 merge 2026-05-04 20:57:36 +02:00
DEPLOYMENT.md refactor(docs): sweep DA_* env vars + surviving da-verbs in docs/*.md (Task 0.5 fix) 2026-05-04 16:43:15 +02:00
development.md feat(observability): request_id end-to-end + dev debug toolbar + centralized logging (#136) 2026-04-29 22:54:21 +02:00
HACKATHON.md docs: add HACKATHON.md — condensed deploy + dev playbooks (#21) 2026-04-21 21:33:06 +02:00
HEADLESS_USAGE.md chore(docs): replace stale da verbs and vendor-specific install paths 2026-05-04 21:22:19 +02:00
llm-routing.md docs,tests: anonymize customer references 2026-04-21 11:56:19 +02:00
local-development.md feat(dev): add Windows PowerShell wrapper for local development (#80) 2026-04-28 23:59:11 +02:00
ONBOARDING.md ci: propagate infra-v* tags to template repo + auto-merge rules (#17) 2026-04-21 21:32:58 +02:00
pd-ps-comments.md feat(memory): corporate memory v1+v1.5 + 0.15.0 (#72) 2026-04-29 07:16:22 +02:00
QUICKSTART.md chore(docs): replace stale da verbs and vendor-specific install paths 2026-05-04 21:22:19 +02:00
RBAC.md refactor(docs): sweep DA_* env vars + surviving da-verbs in docs/*.md (Task 0.5 fix) 2026-05-04 16:43:15 +02:00
RELEASE_CHECKLIST.md docs: clean-install manual protocol in release checklist 2026-05-04 19:23:01 +02:00
RELEASE_TEMPLATE.md feat: multi-instance deployment — all 14 must-have items from spec 2026-04-10 11:57:42 +02:00
sample-data.md chore(docs): replace stale da verbs and vendor-specific install paths 2026-05-04 21:22:19 +02:00
security-audit-2026-04.md chore(oss): isolate customer-specific deploy bits from scripts/grpn/ (#88, wave 1) (#94) 2026-04-27 20:24:34 +02:00
state-dir.md fix: Devin Review on #194 round 2 — 3 BUG-class findings 2026-05-05 20:02:50 +02:00
theme-reference.html Fix clipped annotation badges in theme-reference.html 2026-03-11 14:09:04 +01:00