agnes-the-ai-analyst/docs
ZdenekSrotyr c3e82972c8
feat(bq): decouple table_registry bucket from BQ dataset name (#343) (#346)
* feat(bq): decouple table_registry bucket from BQ dataset name (#343)

Adds optional `bq_fqn` column (schema v51) carrying the fully-qualified
BigQuery path (project.dataset.table) so the rebuild path no longer has
to reconstruct it from the dual-purpose `bucket` field (which is also a
UX/RBAC label).

- Schema v51 migration + _SYSTEM_SCHEMA carry the nullable column;
  rows without it keep using the legacy bucket+source_table+
  remote_attach.project path (backwards compat).
- BQ extractor honors bq_fqn per row when present: dataset/table
  override on same-project rows; cross-project VIEW path works via
  bigquery_query(billing, ...); cross-project BASE TABLE skipped with
  a clear warning (multi-ATTACH per project deferred to follow-up).
- Orchestrator pre-pass detects drift between extract.duckdb
  _remote_attach.url and overlay data_source.bigquery.project, calls
  rebuild_from_registry to regenerate when they differ. Closes the
  operational hazard where /admin/server-config edits silently left
  the on-disk extract pointing at the old project until the next
  manual sync.
- Startup config check warns when project ≠ billing_project without
  location set (the on-disk symptom is "provider returned no data"
  silently in metadata cache), and when a warehouse-like data project
  has no billing_project override (silent 403 serviceusage path).
- _resolve_bq_location warning now points at the location config key
  explicitly so operators see the actionable fix in the log.
- POST /api/admin/register-table and PUT /api/admin/registry/{id}
  accept bq_fqn; malformed values rejected at the API boundary (422).
- 25 tests covering parse_bq_fqn matrix, extractor override paths
  (same-project + cross-project VIEW + cross-project BASE TABLE skip),
  orchestrator drift sync, startup-validator heuristic, admin models.

UI surface for bq_fqn input in /admin/tables intentionally omitted from
this PR (3.5k-line template change) — admins can register through the
REST API or `agnes admin` CLI in the meantime. Multi-project ATTACH
support is the same scope deferral as the cross-project BASE TABLE
skip; both ride a follow-up PR.

* review fixes: abstract CHANGELOG, merge duplicate Changed, bump docs schema version

- CHANGELOG.md: remove customer-specific hostname + incident date range
  from the orchestrator drift-sync entry (vendor-agnostic OSS rule),
  fold the entry into the existing [Unreleased] ### Changed section
  instead of opening a duplicate heading.
- docs/architecture.md: bump 'Current schema version' from 19 to 51 to
  match SCHEMA_VERSION (per agnes-orchestrator skill rule #4).

* review fixes: vendor-agnostic test fixture + Schema v51 internal bullet

- tests/test_bq_fqn.py: replace customer GCP project ID with generic
  'my-warehouse-project' placeholder (vendor-agnostic OSS rule). Test
  asserts on the warehouse-like heuristic, not the literal project
  name, so the rename is behavior-neutral.
- CHANGELOG.md: add explicit '\*\*Schema v51\*\*' bullet under
  `### Internal` naming the new version + summarizing the additive
  nullable column (matches the convention from v47/v48 bullets).

* fix(bq): cross-project _detect_table_type bills against extractor project

Addresses Devin review on #346 — pre-fix _detect_table_type passed the
data project as BOTH the FROM-clause target AND the bigquery_query()
first arg (billing project). For cross-project bq_fqn rows where
fqn_project != project_id, the data SA holds bigquery.dataViewer on
fqn_project but the serviceusage.services.use permission only on
project_id, so the call 403'd. init_extract's broad except Exception
swallowed the error and silently skipped the row, meaning the
cross-project VIEW path at extractor.py:~696 — the PR's primary
cross-project use case — never executed.

- Add optional billing_project kwarg to _detect_table_type; defaults
  to project for backwards compat (same-project callers unaffected).
- Update the init_extract call site to pass billing_project=project_id
  explicitly. Same-project rows (fqn_project == project_id) are a
  no-op; cross-project rows now route billing to the project where
  the SA actually has services.use.
- 2 new tests in TestDetectTableTypeBilling cover (a) explicit
  billing_project routing to bigquery_query 1st arg + data project
  staying in FROM, and (b) the backwards-compat default. Plus
  test_cross_project_detect_call_bills_against_extractor_project
  pins the call-site wiring — captures the (project, billing_project)
  pair the extractor passes for a cross-project bq_fqn row.

* release: 0.54.29 — bq_fqn decoupling + marketplace refactor + setup-script UX

Accumulated [Unreleased] content from #342 (flea marketplace refactor),
#344 (setup script step-2 cwd check), and #346 (this PR — bq_fqn column
+ orchestrator drift sync + startup config check). Schema v51.
2026-05-19 11:17:32 +00:00
..
admin release: 0.47.0 — source-agnostic catalog metadata + cache discipline (#223) 2026-05-07 18:33:55 +02:00
archive docs: consolidate and de-clutter the documentation tree (#306) 2026-05-14 18:54:22 +00:00
examples Marketplace UX overhaul: rich plugin/skill/agent detail + filename rename (#251) 2026-05-12 08:38:39 +00:00
HOWTO feat(cli): agnes marketplace search/detail/add/remove + retire stale subcommands (#280) 2026-05-13 05:20:56 +00:00
metrics
operator feat(home): state-aware /home + /setup-advanced + schema v26 (#228) 2026-05-08 18:28:47 +02:00
setup release: 0.47.1 — Keboola connector v27 (incremental, partitioned, where_filters, typed parquet) (#217) 2026-05-07 19:01:27 +02:00
superpowers feat: Agnes specialist agents and skills under .claude/ (#328) (#328) 2026-05-15 20:39:11 +02:00
testing
ADR-corporate-memory-v1.md
agent-setup-prompt.md
agent-workspace-prompt.md
architecture.md feat(bq): decouple table_registry bucket from BQ dataset name (#343) (#346) 2026-05-19 11:17:32 +00:00
auth-google-oauth.md
auth-groups.md
CONFIGURATION.md Activity Center: audit log + telemetry + sessions + agnes_* tables (#278) 2026-05-12 22:41:19 +02:00
corporate-memory-governance.md
curated-marketplace-format.md Marketplace UX overhaul: rich plugin/skill/agent detail + filename rename (#251) 2026-05-12 08:38:39 +00:00
DATA_SOURCES.md remove agnes query --register-bq from client CLI 2026-05-12 18:18:13 +02:00
DEPLOYMENT.md Activity Center: audit log + telemetry + sessions + agnes_* tables (#278) 2026-05-12 22:41:19 +02:00
development.md
HEADLESS_USAGE.md feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
initial-workspace-override.md fix: refresh-marketplace enables stack plugins; override sentinel is init-time only (#307) 2026-05-14 18:43:32 +02:00
llm-routing.md
local-development.md feat(web): consolidate the personal /me/* surface — /me/activity + /me/profile (#304) 2026-05-14 21:29:51 +02:00
marketplace.md docs: consolidate and de-clutter the documentation tree (#306) 2026-05-14 18:54:22 +00:00
observability.md feat(observability): optional PostHog integration (#231) 2026-05-08 17:57:10 +04:00
ONBOARDING.md Activity Center: audit log + telemetry + sessions + agnes_* tables (#278) 2026-05-12 22:41:19 +02:00
PLATFORM_SETUP.md feat(marketplace): telemetry v46 + flea inner parity + listing polish (#329) 2026-05-15 20:58:03 +02:00
QUICKSTART.md docs: consolidate and de-clutter the documentation tree (#306) 2026-05-14 18:54:22 +00:00
RBAC.md
README.md docs: consolidate and de-clutter the documentation tree (#306) 2026-05-14 18:54:22 +00:00
RELEASE_CHECKLIST.md docs: consolidate and de-clutter the documentation tree (#306) 2026-05-14 18:54:22 +00:00
RELEASING.md ci: consolidate release pipeline (salvageable subset of #139) (#314) 2026-05-15 14:06:59 +02:00
sample-data.md
state-dir.md fix: Devin Review on #194 round 2 — 3 BUG-class findings 2026-05-05 20:02:50 +02:00
STORE_GUARDRAILS.md fix(store): surface review failures + harden publish gate (#316) 2026-05-15 15:52:07 +02:00
theme-reference.html

Agnes documentation

Index of all documentation, organized by who needs it. New here? Start with the row that matches your role.

You are… Start with
Analyst — using Agnes to query data QUICKSTART.md, then HOWTO/
Operator — deploying & running an instance PLATFORM_SETUP.md
Developer — working on Agnes itself ../ARCHITECTURE.md + architecture.md

For analysts

Using the platform to analyze data.

  • QUICKSTART.md — local setup + first sync
  • HOWTO/ — task-oriented cookbook (querying, snapshots, common workflows)
  • DATA_SOURCES.md — data source connectors (Keboola, BigQuery, CSV) and how tables surface
  • metrics/ — canonical business-metric definitions (YAML)
  • HEADLESS_USAGE.md — PAT auth for CI / headless clients

For operators

Deploying, configuring, and running an Agnes instance.

For developers

Working on the Agnes codebase.

Code-adjacent READMEs: ../connectors/jira/README.md, ../services/corporate_memory/README.md, ../scripts/README.md. Agent skill files: ../cli/skills/.

Other