Five hottest BQ-touching endpoints were `async def` but invoked synchronous DuckDB / BQ-extension calls inside the body. Under uvicorn's single event loop that meant a single heavy `agnes query --remote` (waiting up to ~200 s for BQ's jobs.query) froze EVERY other request — /api/health, dashboard, auth, even another query — for the full BQ wait. Operators saw "VM idle, app frozen" during PR #188's testing. Convert to plain `def` so FastAPI auto-offloads the body to the anyio thread pool. Event loop stays free for non-BQ requests. - app/api/query.py:execute_query - app/api/v2_scan.py:scan_estimate_endpoint, scan_endpoint - app/api/v2_sample.py:sample - app/api/v2_schema.py:schema Audit: 0 `await` statements in any converted handler (verified file-by- file), so the rename is safe. Tests in tests/test_v2_*.py called the handlers via `asyncio.run(...)` which now fails on a non-coroutine return; swapped for direct calls (asyncio.run( -> ( ) — keeps paren balance). Plus AGNES_THREADPOOL_SIZE env var (default 200, was anyio's stock 40) in app/main.py:lifespan. Set via anyio.to_thread.current_default_thread_limiter().total_tokens. 200 is comfortable headroom for <50 concurrent analysts; bump for more. 480/480 impacted tests pass (the 2 remaining errors are a pre-existing fixture setup issue in test_reader_smoke_matrix.py unrelated to this change).
232 KiB
Changelog
All notable changes to Agnes AI Data Analyst.
Format: Keep a Changelog. Versions follow Semantic Versioning, pre-1.0 — public surface (CLI flags, REST endpoints, instance.yaml schema, extract.duckdb contract) may shift between minor versions; breaking changes called out under Changed or Removed with the BREAKING marker.
CalVer image tags (stable-YYYY.MM.N, dev-YYYY.MM.N) are produced for every CI build; semver tags (v0.X.Y) are cut at release boundaries and reference the same commit as a stable-* tag from the same day.
[Unreleased]
Changed
- Tier 1 event-loop unblocking — the five hottest BQ-touching endpoints (
POST /api/query,POST /api/v2/scan,POST /api/v2/scan/estimate,GET /api/v2/sample/{id},GET /api/v2/schema/{id}) were declaredasync defbut invoked synchronous DuckDB / BQ-extension calls inside the body. Under uvicorn's single event loop that meant a single heavyagnes query --remote(waiting up to ~200 s for BQ'sjobs.queryto return) froze every other request —/api/health, the dashboard, auth, even another query — for the full duration of the BQ wait. Operators saw "VM idle, app frozen" symptoms during this work. Converted all five to plaindefso FastAPI auto-offloads the blocking body to the anyio thread pool; the event loop stays free for non-BQ requests. Verified via 0-await audit (noawaitstatements in the converted handlers, so the rename is safe). Tests:tests/test_v2_*.pywere rewritten to call the handlers directly instead ofasyncio.run(...)(which now fails on a non-coroutine return). Pairs with the thread-pool capacity bump below. AGNES_THREADPOOL_SIZEenv var (default 200, was anyio's stock 40) controls the FastAPI / Starlette thread pool capacity used by every plain-defroute handler. Set inapp/main.py:lifespanviaanyio.to_thread.current_default_thread_limiter().total_tokens. 200 leaves comfortable headroom over the BQ extension's connection budget while keeping the per-process thread cost bounded — for the workload of <50 concurrent analysts this is well over what's needed; bump for higher concurrency.
Added
data_source.bigquery.query_timeout_msconfig knob (default 600 000 ms = 10 min). The DuckDB BigQuery extension's built-in default of 90 s was too tight for analyst-scale queries against view-backed BQ datasets —agnes query --remotewould HTTP 400 withBinder Error: Query execution exceeded the timeout. Job ID: …whenever the underlying BQ job took longer than 90 s, even though the BQ job itself was healthy. The new knob is applied viaSET bq_query_timeout_msafter everyLOAD bigqueryon every BQ-touching DuckDB session — the orchestrator's_remote_attachATTACH path (src/orchestrator.py), the analytics-DB read-only reattach path (src/db.py:_reattach_remote_extensions— the primaryagnes query --remoterequest path), theBqAccesssession factory (connectors/bigquery/access.py), and the standalone extractor (connectors/bigquery/extractor.py). Sentinel0(or non-numeric / unparseable values) leaves the extension default in place so operators on legacy extension versions that don't recognise the setting aren't broken. Configurable via/admin/server-configUI. Note: BigQuery'sjobs.queryRPC caps the wait at ~200 s per call regardless of this setting; the extension polls on top so the effective ceiling is the value here but each poll is ~200 s. DuckDB emits an informational warning when the value is set above the BQ RPC cap — operators can safely ignore it.- Per-user parallel parquet downloads in
agnes pull— the download loop incli/lib/pull.pynow uses aThreadPoolExecutorwith concurrency capped by the newAGNES_PULL_PARALLELISMenv var (default 4, set 1 to restore pre-PR serial behavior). On a registry of N tables the wall-clock time drops fromΣ stream_download_seconds(table_i)to roughlymax × ceil(N/4). Works hand-in-hand with the Caddyfile_serverchange below: without it parallel client-side downloads would still queue on the single uvicorn worker; with it each request is its own caddy goroutine + sendfile, so 4-way parallelism actually delivers throughput. Per-table error semantics preserved — a failure on one table no longer aborts the rest of the batch. scripts/ops/agnes-auto-upgrade.shnow re-fetches Caddyfile + every compose overlay fromkeboola/agnes-the-ai-analyst@mainon every tick, hashes them, and triggers adocker compose up -drecreation when the hash changes — same path as an image-digest change. Pre-fix the script only watcheddocker imagesdigests, so a Caddyfile or compose change in main never reached running VMs (only fresh boots ranstartup.sh's file fetch). Without this, the new file_server downloads-path below would land in the image but stay inert against an old Caddyfile. The script also self-updates from the same path so the very fix that watches config files isn't itself stuck on running VMs. Fail-soft on curl errors — keeps the existing file rather than blanking it.- Caddy
file_serverfor parquet downloads —GET /api/data/{table_id}/downloadis now intercepted at the Caddy layer (TLS profile only) and served directly via sendfile/zero-copy from the data volume mounted read-only at/srvinside the caddy container. Caddy authorises every request via a new lightweight RBAC probeGET /api/data/{table_id}/check-access(returns 204 when the caller has read access on the table, 403 otherwise) using theforward_authdirective — the bulk byte transfer never touches uvicorn workers. Resolves a real production failure mode where a single multi-GB analyst pull held the app's only uvicorn worker for the duration of the stream and starved the UI //api/health/ every other API endpoint, eventually flipping the container tounhealthy. Path discovery uses Caddy'stry_filesover the knownextract.duckdbv2 source subdirs (bigquery/data/<id>.parquet,keboola/data/<id>.parquet,jira/data/<id>.parquet); a parquet not at any of those paths transparently falls through to the existing app handler so legacysrc_data/parquetlayouts and future connectors keep working with no Caddyfile change. Non-Caddy deployments (devdocker compose upwithout--profile tls) continue to use the app handler unchanged. - Workspace prompt: decision tree, common-mistakes callout, failure-mode dictionary in
config/claude_md_template.txt(the templateagnes initwrites to<workspace>/CLAUDE.md). Surfaces every catalog-row field analyst Claude should read before deciding which command to use (query_mode,sql_flavor,where_examples,fetch_via,rough_size_hint); explicitly binds--estimatetoagnes snapshot createONLY (was the most-failed first-try misuse — fails withNo such option: --estimateonagnes query); calls out theagnes fetch→agnes snapshot createrename so stale-doc analysts don't run a non-command; documents the BQ permission model (server SA, not personal Google identity) and a 6-row failure-mode table mapping each common error wording to its cause + the right next step. rough_size_hintpopulated forlocal+materializedcatalog rows inGET /api/v2/catalog(was hardcodednullwith a "Task 8" TODO). Reads the parquet file size at${DATA_DIR}/extracts/<source_type>/data/<table_id>.parquetand buckets intosmall(≤100 MiB),medium(≤1 GiB),large(≤10 GiB),very_large(>10 GiB).remoterows staynullfor now (size requires a BQ INFORMATION_SCHEMA call; tracked separately). Lets analyst Claude pickagnes snapshot createoveragnes query --remoteby inspectingagnes catalog --jsonrather than discovering size empirically via a failed--remoteround-trip.
Changed
- CLI update-banner now says
agnesinstead ofda(cli/update_check.py:format_outdated_notice). The string[update] da X is out of datehad survived theda→agnesCLI rename and was the most-visible stale identifier in the analyst-facing surface — every CLI command printed it on stderr when a newer wheel was available.
Fixed
- Keboola sync now falls back to the legacy Storage-API client when the DuckDB Keboola extension's per-table scan fails, not just when the initial
ATTACHfails. Two changes:kbcstorage>=0.9.0is promoted from optional to core dependency. The legacy fallback path inconnectors/keboola/extractor.py:_extract_via_legacyhas been there since the extension landed, but until now the barefrom kbcstorage.client import Clientwould crash any default install withModuleNotFoundError.connectors/keboola/extractor.py:runnow wraps_extract_via_extensionin a per-table try/except — on any per-table scan failure it retries via the legacy client. Previously, whenATTACHsucceeded but the table-levelCOPY (SELECT * FROM kbc."<bucket>"."<table>")failed, the table was just marked failed with no retry. Together these unblock deployments where the extension's bucket-schema scans returnSchema '..."in.c-..."' does not exist or not authorized(keboola/duckdb-extension#17) while the upstream extension fix is in flight.
[0.35.1] — 2026-05-05
Fixed
agnes query --remoteno longer dies after 30s on long-running BigQuery SELECTs. The CLI HTTP client now defaults to a 300s timeout for/api/queryand exposesAGNES_QUERY_TIMEOUT(seconds, float) for operators who need to extend it further. Other CLI calls keep the 30s default. (cli/client.py,cli/commands/query.py)
[0.35.0] — 2026-05-05
Five-defect fix for the silently-broken session pipeline on default Compose deploys (#176). Sessions uploaded by agnes push landed on /data/user_sessions/<user>/*.jsonl, but on a stock docker compose up deploy nothing ever processed them — /corporate-memory stayed empty even when sessions and CLAUDE.local.md were uploaded. The root cause was a stack of compounding defects: LLM SDKs were dev-only deps so the scheduler container boot-looped on ModuleNotFoundError, the side-car services were profile-gated and ran as tight restart: unless-stopped boot loops anyway, the verification_detector had no scheduler entry at all, the first-time setup never seeded an ai: block, and the /corporate-memory page silently filtered out the pending review queue. This release wires the LLM pipeline into the existing scheduler-v2 model (one HTTP-driven cron tick per service) and adds a health-check that warns when uploaded jsonls aren't being processed.
Changed
- BREAKING
docker-compose.ymlanddocker-compose.prod.ymlno longer ship thecorporate-memoryandsession-collectorservices. The scheduler container drives both jobs through admin HTTP endpoints (see Added below) on offset cadences (10 min / 17 min). Operators previously runningCOMPOSE_PROFILES=fullor maintaining custom Compose overrides need to drop those service stanzas — leaving them in produces a double-driver footgun (the standalone container loop races the scheduler-v2 cron tick on/data/user_sessionsandknowledge_itemswrites). The Python entry points (services/{corporate_memory, session_collector, verification_detector}/__main__.py) remain — they're still callable from the CLI for one-shot manual runs and from the new admin endpoints.
Added
- New admin endpoints in
app/api/admin.pythat wrap the LLM pipeline jobs so the scheduler can drive them over HTTP (matching the existing/api/marketplaces/sync-allpattern):POST /api/admin/run-session-collector— copies Claude Code session jsonls from user homes to/data/user_sessions/<user>/.POST /api/admin/run-verification-detector— extracts verified knowledge from session transcripts via the LLM, writes pending items toknowledge_items.POST /api/admin/run-corporate-memory— refreshes the catalog from teamCLAUDE.local.mdfiles. All three are admin-gated, sync-def (FastAPI thread pool), and emit one audit row per invocation.
- Three new entries in
services/scheduler/__main__.py:JOBSwith deliberately offset cadences (10 m / 15 m / 17 m, all coprime modulo the 30 s tick) so the LLM-backed jobs don't fire on the same tick and stack their API + DB load:session-collector— every 10 min →POST /api/admin/run-session-collector.verification-detector— every 15 min →POST /api/admin/run-verification-detector.corporate-memory— every 17 min →POST /api/admin/run-corporate-memory.
connectors.llm.factory.create_extractor_from_env_or_config(ai_config)— falls back toANTHROPIC_API_KEY/LLM_API_KEYenv vars when theai:block is empty, raises a clearValueErrorwhen neither is available.services/corporate_memoryandservices/verification_detectorswitch to the new helper so a missingai:section is no longer a silent skip.POST /api/admin/configurenow seeds a defaultai:block into the writableinstance.yamloverlay when the overlay has noai:yet ANDANTHROPIC_API_KEY(orLLM_API_KEY) is present in the environment. The block stores the env-var reference (${ANTHROPIC_API_KEY}), never the raw secret. Existing operator config is preserved verbatim./corporate-memorypage renders an admin-only banner (N pending items awaiting review — review them at /corporate-memory/admin) when the pending review queue is non-empty. Non-admins see no change — the route zeroes the count server-side before the template renders. Closes the silent-failure UX gap that hid the review queue from operators withapproval_mode='review_queue'(the default).GET /api/health/detailednow returns asession_pipelineservice entry that warns when uploaded session jsonls aren't being processed. Heuristic:max(mtime of /data/user_sessions/**/*.jsonl) <= max(processed_at in session_extraction_state) + grace_seconds, wheregrace_seconds = 2 ×the verification-detector cadence (default 30 min, configurable viaSCHEDULER_VERIFICATION_DETECTOR_INTERVAL). Surfaces asstatus='warning'(nevererror) with an actionabledetailpointing at the verification-detector job. A warning bubbles up to the existingoverall='degraded'aggregation soagnes diagnose systemflags it.
Fixed
- Defect 4 — LLM provider SDKs in dev-only deps caused scheduler container boot loops.
anthropic>=0.30.0andopenai>=1.30.0are now in[project].dependencies, not[project.optional-dependencies].dev. The Dockerfile'suv pip install --system --no-cache .picks them up automatically, no Dockerfile change required.tests/test_packaging.pylocks the contract. - Defect 5 — first-time setup never wrote an
ai:block. Two paths to a working LLM pipeline now actually work end-to-end (#179 review): (a) a defaultai:block seeded byPOST /api/admin/configureinto the writable overlay at${DATA_DIR}/state/instance.yamlwhen env keys are present (Added above), or (b) env-var fallback at service start time. The seeded overlay path was dead code on the initial 0.35.0 cut — the three LLM consumers (services/corporate_memory/collector.py,services/verification_detector/__main__.py,app/api/admin.py:run_verification_detector) importedload_instance_configfromconfig.loader(which only reads the static config dir), and even if they had read the overlay,app/instance_config.pyranyaml.safe_loadon it without resolving${ENV_VAR}references so the seeded${ANTHROPIC_API_KEY}placeholder would have stayed literal. Both fixes shipped: consumers switched to the overlay-awareapp.instance_config.load_instance_config, and the overlay is now passed throughconfig.loader._resolve_env_refsbefore deep-merge with the static base.collect_allno longer swallows the factory'sValueErrorintostats["errors"]— fail-fast propagates so the scheduler / admin endpoint surface the actionable misconfiguration message. - #179 review — scheduler ignored its own LLM cadence env vars.
app/api/health.pyalready readSCHEDULER_VERIFICATION_DETECTOR_INTERVALto compute the staleness grace window, but the scheduler cadence was hardcoded toevery 15m, so an operator throttling the detector via the env was silently ignored on the schedule side while the health grace silently widened. All three LLM-pipeline cadences are now env-driven through the same_read_positive_intpattern asdata-refresh/health-check/script-runner:SCHEDULER_SESSION_COLLECTOR_INTERVAL(default 600s = 10m),SCHEDULER_VERIFICATION_DETECTOR_INTERVAL(default 900s = 15m), andSCHEDULER_CORPORATE_MEMORY_INTERVAL(default 1020s = 17m). Defaults preserve the 10/15/17m coprime offset so the three jobs don't fire on the same tick. The verification-detector env var remains the single source of truth for the health-check grace (still2 ×the cadence). - Defect 3 —
verification_detectorhad no scheduler entry. Now inJOBSwith a 15 min cadence, hitting the new/api/admin/run-verification-detectorendpoint. - Defect 2 — side-car services gated by
profiles: [full]were silently skipped on default deploys. Both stanzas dropped (Changed above); the scheduler-v2 cron is the sole driver. - Defect 1 —
/corporate-memoryfilteredstatus IN ('approved','mandatory')with no hint that pending items existed. Admin banner added (Added above). - #179 review —
/api/admin/run-session-collectorwould SystemExit the worker. The endpoint calledcollector.main(), whoseargparse.parse_args()parsed uvicorn'ssys.argv(['app.main:app', '--host', …]) and calledsys.exit(2)on the unrecognised flags.SystemExitinherits fromBaseException, escapes FastAPI's exception machinery, and propagates through the thread pool — every scheduler tick that fired the endpoint either 500-ed or risked killing the uvicorn worker. Fix:services/session_collector/collector.pynow exposes an argv-freerun(dry_run, verbose) -> (rc, stats)helper;main()is a thin CLI shim around it and the admin endpoint callsrun()directly. Audit log now carries the per-run stats (users_processed,files_copied,files_skipped) instead of just the rc. Regression tests intests/test_session_collector.py::TestRunHelper. - #179 review —
python -m services.corporate_memorycrashed on missing LLM config instead of exiting cleanly. The PR's fail-fast change madecollect_all()raiseValueErrorwhen neither anai:block norANTHROPIC_API_KEY/LLM_API_KEYwas available. Theverification_detectorCLI was updated to catch it; the corporate-memory CLI was missed. Now also wrapped — operators get a one-lineCorporate Memory cannot run: <factory message>on stderr and rc=1 instead of a raw traceback. Regression test intests/test_llm_connector.py::TestCorporateMemoryCollector::test_main_returns_1_on_no_ai_config_instead_of_traceback. - E2E test — Anthropic API rejected every extraction request. The structured-output API now requires
additionalProperties: falseon every{"type": "object"}node in the json_schema; without it the API returns 400invalid_request_error("output_config.format.schema: For 'object' type, 'additionalProperties' must be explicitly set to false"). Surfaced on a real BQ-backed deploy: every uploaded session jsonl failed verification-extraction in a tight retry loop. Fix:connectors/llm/anthropic_provider.pynow wraps the caller-supplied schema through a recursive_strict_json_schema()walker that adds the field where missing (preserving any explicit operator override), then passes the strict variant to the API. Six unit tests intests/test_llm_connector.py::TestStrictJsonSchemapin the recursion across nested objects, array items, and the no-mutation invariant. - #179 review —
/api/admin/run-verification-detectorskipped audit on unhandled exceptions. Ifdetector.run()threw anything other than the already-translatedValueError(DuckDB lock, network blip, unexpected SDK error), the audit_log row was never written — the operator's only signal wasdocker logs agnes-scheduler-1. The endpoint now wrapsdetector.runin try/except, records the exception inaudit_params["unhandled_error"], then re-raises as 500 after audit. The/admin/scheduler-runspage surfaces the failure row with the error type and message. - #179 review —
SCHEDULER_AUDIT_ACTIONSlisted action strings that don't actually appear inaudit_log. The list atapp/web/router.py:952had"marketplaces_sync_all"(wrong — actual is"marketplace.sync_all") plus"data_refresh"and"scripts_run_due"(whichapp/api/sync.pyandapp/api/scripts.pydon't write). Corrected to the four actually-logged strings, with a comment pointing at the missing audit calls in sync/scripts as a follow-up. - #179 review —
/api/admin/run-corporate-memoryskipped audit on unhandled exceptions (same gap asrun_verification_detectorfrom the previous round). Mirrored the same try/except +unhandled_erroraudit pattern, so a DuckDB lock or unexpected SDK error fromcollect_all()now produces an audit row with the error type+message before re-raising as 500. Regression test intests/test_admin_run_endpoints.py::TestRunCorporateMemory::test_unhandled_exception_still_audits. - #179 review —
/api/admin/run-session-collectorskipped audit on unhandled exceptions (third occurrence of the same pattern, completes the trilogy of LLM-pipeline endpoints). Mirrored the same try/except +unhandled_erroraudit pattern from the other two endpoints, so aPermissionErrorwalking/home, anOSErroron/data/user_sessionsmkdir, or any other unhandled exception fromcollector.run()now produces an audit row before re-raising as 500. Regression test intests/test_admin_run_endpoints.py::TestRunSessionCollector::test_unhandled_exception_still_audits. - #179 review —
/profile/sessions500-ed on transientstat()failure. The previous implementation usedsorted(glob, key=lambda p: p.stat().st_mtime); if any single jsonl file's stat call raised (race with delete, EACCES from a remount, etc.), the whole sort raised and the page returned 500 instead of just dropping that one row. Reworked the gather: stat each path under try/except into a(path, stat)list, then sort the already-statted entries. Bad files are silently dropped from the listing. Regression test intests/test_web_ui.py::TestAdminRoleGuards::test_profile_sessions_page_tolerates_stat_failures.
Added
/admin/scheduler-runs— read-only admin page showing the last 200 audit-log entries from scheduler-driven actions (run_session_collector,run_verification_detector,run_corporate_memory,marketplace.sync_all). NewAuditRepository.query_actions(actions, limit)query helper, new admin nav entry under the Admin dropdown.data-refresh(POST /api/sync/trigger) andscript-runner(POST /api/scripts/run-due) are scheduler jobs but don't write toaudit_logtoday, so they can't appear here yet. Failed scheduler ticks (HTTP 401, network errors) don't reach the audit_log either — those still live only indocker logs agnes-scheduler-1; the page calls that out with a hint to setSCHEDULER_API_TOKENif no rows show up./profile/sessions— self-service user page in the user menu, showing all session jsonls the caller uploaded viaagnes pushjoined againstsession_extraction_state. Each row shows uploaded_at, file size, status badge (pending/processed/extracted), processed_at,items_extracted, and a per-row Download button. The page docstring explicitly calls out thatitems_extracted = 0means the verification detector ran successfully but the LLM found no claims worth tracking — that's the documented "no items" outcome, not a broken pipeline. Closes the gap surfaced during the e2e test of #176 where a user could see their sessions on disk and process them through the LLM but had no UI to inspect what happened.GET /profile/sessions/<filename>— owner-only download of a single jsonl. Auth viaget_current_user; path safety locks the served file under${DATA_DIR}/user_sessions/<caller.id>/and rejects path-traversal / nested-component / non-.jsonl/ dotfile filenames with 404 (never 403, so existence of files belonging to other users is not leaked).Content-Disposition: attachmentreturns the file as a download.
Internal
tests/test_packaging.py— guards againstanthropic/openaislipping back into dev extras.tests/test_setup_ai_block.py— overlay seeding contract forPOST /api/admin/configure.tests/test_llm_provider_env_fallback.py— env fallback + fail-fast forcreate_extractor_from_env_or_config.tests/test_admin_run_endpoints.py— admin gating + scheduler registration + endpoint contract for the three new run-* endpoints.tests/test_docker_compose.py— pins the compose contract: the two side-car services must not reappear under either Compose file.tests/test_corporate_memory_page.py— pending-banner contract (admin sees, non-admin doesn't).tests/test_health_session_pipeline.py— session-pipeline staleness check across cold-start + ok + warning + never-processed cases.tests/test_instance_config_overlay.py— pins overlay env-ref resolution + the three LLM consumers reading fromapp.instance_config(#179 review).tests/test_scheduler.py—TestLLMPipelineCadenceEnvVars+TestVerificationDetectorGraceFollowsCadencepin the new env-var-driven cadences and the single-source-of-truth contract between scheduler and health-check grace (#179 review).docs/architecture.md— Services table updated to reflect the scheduler-v2 cadence map.
[0.34.0] — 2026-05-04
End-to-end clean-analyst-bootstrap rewrite. The web /setup page now produces a single unified paste prompt that, dropped into Claude Code in an empty folder, fully bootstraps a workspace — installs the CLI, authenticates, fetches CLAUDE.md, installs SessionStart/End hooks, runs the first data refresh, and writes a human-readable workspace docs file (AGNES_WORKSPACE.md). The admin-vs-analyst layout split (introduced as ?role= mid-cycle) was collapsed before merge: every caller sees the same flow, with the marketplace + plugins block emitted iff the caller has plugin grants. 26 implementation tasks across 6 phases plus a 10-task unification follow-up.
Changed
- BREAKING CLI binary renamed from
datoagnes. No backward-compat alias is shipped. Update shell aliases, hook commands in any pre-existing.claude/settings.json, scripts, and cron jobs. Reinstall viauv tool install <wheel>; the wheel now ships anagnesentry point. - BREAKING Environment variables and config dir renamed:
DA_CONFIG_DIR/DA_SERVER/DA_NO_UPDATE_CHECK/DA_LOCAL_DIR/DA_TOKEN/DA_STREAM_RETRIES→AGNES_*;~/.config/da/→~/.config/agnes/. Hard cutover, no fallback. Existing analysts re-authenticate viaagnes auth import-token. - BREAKING Analyst bootstrap rewritten end-to-end.
da analyst setupis removed; replaced byagnes init(non-interactive, requires--server-urland--token).da syncis split intoagnes pull(refresh) andagnes push(upload).da fetchis folded intoagnes snapshot create.da metrics list/showis folded intoagnes catalog --metrics;da metrics import/export/validatemove toagnes admin metrics {import,export,validate}. Theda analystnamespace is removed; the workspace status command is nowagnes status. The previousda status(server-health overview) becomesagnes diagnose system. - BREAKING Workspace layout simplified. Removed:
data/parquet/,data/duckdb/,data/metadata/,user/artifacts/. Canonical paths:server/parquet/(synced parquets),user/duckdb/analytics.duckdb(DuckDB views),user/snapshots/(ad-hoc snapshots),user/sessions/(recorded sessions). Lazy-mkdir contract — no empty pre-allocated directories. - BREAKING
/setupis now a single unified flow regardless of caller's role. The?role=query parameter (introduced earlier in this Unreleased cycle but never released) is removed before merge — no migration needed. The admin tile is gone. PAT scope is uniform: every install-page mint usesscope=generalwithexpires_in_days=90, calling the existingPOST /auth/tokensendpoint. Thebootstrap-analyst1 h-clamped scope is no longer used from/setup(still defined in code for future reuse, see open issue for redesign). The marketplace + plugins block is emitted iff the caller has plugin grants inresource_grants.agnes initis now part of every setup flow (admin and analyst alike) — it's the workspace-rails delivery mechanism./installcontinues to 302 to/setup. CLAUDE.mdserver-side template + repo-rootCLAUDE.mdupdated to reference the new CLI verbs and workspace paths. The admin UI for theclaude_md_templateDB override (/admin/workspace-prompt) renders a yellow banner when the saved override contains legacy strings (data/parquet/,da sync,da fetch,da analyst setup,da metrics list/show); admins re-author and save to clear it. Migration is manual.
Added
agnes init <opts>— non-interactive workspace bootstrap orchestrator. 8 steps: detect existing workspace, verify PAT (GET /api/catalog/tables), save config + token globally, fetchCLAUDE.mdfrom/api/welcome, install SessionStart/End hooks viacli/lib/hooks.py:install_claude_hooks, writeCLAUDE.local.mdstub (preserved on--force), run firstagnes pull, writeAGNES_WORKSPACE.md. Errors render viacli/error_render.py:render_error()with typed kinds (auth_failed,server_unreachable,partial_state,manifest_unauthorized).agnes pull/agnes push— split from the oldda sync/da sync --upload-only.--quiet/--json/--dry-runflags. SessionStart hook runsagnes pull --quiet; SessionEnd hook runsagnes push --quiet.agnes snapshot create <table>— folded fromda fetch. Addsif not local_db.exists()guard soagnes snapshot createno longer silently materializes an empty DuckDB file when run before anyagnes pull.agnes catalog --metrics(replacesda metrics list) andagnes catalog --metrics --show <id>(replacesda metrics show).agnes admin metrics {import,export,validate}— write paths relocated from the deletedda metricsnamespace.agnes diagnose system— server-side health check (was the oldda status).AGNES_WORKSPACE.md— human-readable workspace docs file generated byagnes initin the workspace root. Documents global install, workspace layout, hooks, cheat sheet, uninstall recipe.- PAT request body now accepts
scope: str = "general"andttl_seconds: int | None = Nonefields. PATs minted withscope="bootstrap-analyst"are TTL-clamped to ≤ 1 h server-side. Existingexpires_in_daysfield continues to work;ttl_secondswins when both are set.ttl_secondsupper bound is 315_360_000 (matchesexpires_in_days <= 3650cap). JWT carries thescopeclaim via newextra_claimsparameter oncreate_access_token; reserved keys (sub/email/typ/iat/jti/exp) cannot be overridden viaextra_claims. Audit log includes the scope. cli/lib/shared-library tree withcli/lib/pull.py:run_pull(data-refresh primitive callable from both the Typer wrapper andagnes init) andcli/lib/hooks.py:install_claude_hooks(workspace-scoped, idempotent Claude Code hook installer)._scan_legacy_stringshelper +legacy_strings_detectedfield onGET /api/admin/workspace-prompt-template— server scans saved CLAUDE.md overrides for stale CLI verbs / paths; the admin UI banner consumes the field./setuppre-flight check (step 4, gated on the marketplace block being present) now verifiesclaude --versionin addition togit --version. Both binaries are needed byclaude plugin marketplace addand the git-clone fallback — checking them together surfaces a clear "install X" message instead of a confusing downstream error. Install hints:npm i -g @anthropic-ai/claude-codefor Linux/WSL plus a doc URL (https://docs.claude.com/claude-code) for macOS / Windows native installers.
Fixed
agnes pull(formerlyda sync) no longer creates.claude/rules/when the corporate-memory bundle is empty.agnes pullno longer createsserver/parquet/when the manifest is empty (mkdir is lazy — only on first per-table write).agnes snapshot create(formerlyda fetch) no longer materializes an emptyuser/duckdb/analytics.duckdbwhen run before anyagnes pull. Friendly hint redirects toagnes pull.- Workspace
agnes statusreads from the canonicalserver/parquet/anduser/duckdb/analytics.duckdbpaths (was reading legacydata/parquet/,data/metadata/last_sync.json). agnes initandagnes pullerrors now use thecli/error_render.pytyped-error renderer (added in 0.32.0), so analyst-facing error UX matches the structured shapeagnes query --remotealready produces.- Schema v24 migration retry path is no longer dead (Devin Review on
db.py:1757, escalated from advisory to critical on rescan). Pre-fix: when_v23_to_v24_finalizehad materialized BQ rows to migrate butdata_source.bigquery.projectwas not configured, it logged a warning per row and returned normally. The schema_version then bumped to 24 unconditionally, theif current < 24:gate in_ensure_schemaskipped the function on every subsequent startup, and the affected rows kept their DuckDB-flavorbq."ds"."tbl"source_query forever — which the new_wrap_admin_sql_for_jobs_apiwrapping path rejects as unparseable BQ SQL with no automatic recovery. The "set the project and restart to retry" log hint pointed at a code path that no longer ran. Fix: the migration now raisesRuntimeErrorBEFORE the schema_version bump when it has rows to migrate but no project_id, blocking startup with a clear actionable error pointing atdata_source.bigquery.project. Operator configures the project, restarts, and the migration completes (schema_version is still at 23, so theif current < 24:gate fires). Side effect: a BQ-using deployment that hasn't set the project blocks startup until they do — that's the right call for a config error that would otherwise silently break materialized tables. Two regression tests intest_schema_v24_source_query_rewrite.py:test_v24_raises_when_project_not_configured_and_rows_need_migration(raise + version-stays-at-23) andtest_v24_skips_clean_when_no_rows_match_even_without_project(no-rows-no-block invariant). agnes admin register-tableUX: three real-world feedback items addressed.--query-mode materializednow requires--bucket(client-side validation; exits with a clear error before hitting the server). The previous help docstring claimed--bucketwas ignored for materialized rows, but the value is actually load-bearing —agnes schema <name>builds the BQ identifier asbq.<bucket>.<source_table>, so an empty bucket registered the row but broke subsequent schema/describe with HTTP 400 "unsafe BQ identifier in registry". Docstring rewritten to reflect reality.- Post-success hints: after a successful registration the CLI now points operators at the two follow-ups they routinely miss: (a)
agnes setup first-syncto materialize the parquet (registration alone doesn't trigger a build;agnes pullreports "Updated 0 tables" until the scheduler tick), and (b)agnes admin grant create <group> table <name>to make the row visible inagnes catalogfor non-admin users (catalog is RBAC-filtered). - Test coverage:
tests/test_cli_admin_materialized.py::test_register_materialized_without_bucket_fails_with_clear_errorandtest_register_table_emits_first_sync_and_grant_hints.
agnes query --remoteSQL rewriter no longer corrupts output when the GCP project ID contains a registered table name as a hyphen-delimited word (Devin Review onquery.py:464). The previous iterative rewrite (onere.sub(\b<name>\b, ...)per registered name) was vulnerable to cross-contamination: e.g. projectmy-ue-project+ registeredorders+ registeredue→ iter 1 rewritesordersto\my-ue-project.fin.orders`, iter 2's\bue\bthen matches theueINSIDEmy-ue-projectand corrupts the iter-1 path. Fix: replaced the iteration with a SINGLEre.subwhose alternation regex (sorted longest-first) handles every name in one pass, so freshly-inserted backticked text isn't re-scanned. The fallback atquery.py:576(per-table SELECT * on BQ parse error) caught the corrupted output asbq_bad_requestso impact was over-estimation rather than fail-open, but the partition-pruning benefit of #171 is now preserved for projects whose IDs share a hyphen-segment with a registered table name. Regression test intests/test_api_query_guardrail.py::test_rewrite_helper_does_not_corrupt_when_project_id_contains_registered_name`.- BigQuery materialize TTL reclaim is no longer dead code (Devin Review on
extractor.py:166)._try_acquire_file_lockused to callopen(lock_path, mode="w")BEFORE checking the lock-file mtime, which truncated the file and refreshed mtime to now on every invocation. The subsequenttime.time() - lock_path.stat().st_mtimealways saw age ~0, soage > TTLnever fired, andmaterialize.lock_ttl_secondswas a silently no-op config knob. Fix: stat the lock path BEFORE anyopen()to read the real pre-probe mtime; if older than TTL, unlink (forcing a fresh inode for the nextopen + flock); only then probe. Two regression tests added:test_stale_held_lock_is_reclaimed_despite_live_holderexercises the full reclaim path with a still-living fcntl holder,test_failed_probe_does_not_self_refresh_lock_mtimepins that a failed acquisition doesn't pathologically loop. Residual cross-process risk (a genuinely overrunning materialize past TTL races a fresh attempt) is documented in the helper docstring; in-processthreading.Lockkeyed ontable_idblocks the single-process race. agnes init --token Xnow correctly uses the explicit token in the verify call, even when~/.config/agnes/token.jsonalready holds a stale token from a prior install. Pre-fixcli.config.get_token()read the on-disk file first and only fell back to env vars, so step 2 (PAT-verify) ran with the stale token and failed with a confusing 401 — even though the--tokenarg was valid (Devin Review oninit.py:99). Fix: aContextVar-based override incli.configshort-circuitsget_token()before the file read;_override_server_env(used by bothagnes initandagnes pull'srun_pull) sets it for the duration of the call. Async-safe (each task sees its own override) and leak-proof (resets on context exit).agnes statussessions counter now reads the same source asagnes push—~/.claude/projects/<encoded-cwd>/(Claude Code's actual write path) with the legacy<workspace>/user/sessions/as a fallback, viacli.lib.claude_sessions.list_session_files(). Pre-fix the counter only checked the legacy dir and always reported 0 in workspaces bootstrapped withagnes init(since Claude Code never writes there).- BigQuery materialize lock-reclaim docstring at
connectors/bigquery/extractor.py:_try_acquire_file_lockcorrected: a still-running holder'sfcntl.flockdoes NOT block the post-unlink reacquisition (new file = new inode = independent lock). The in-processthreading.Lockkeyed ontable_idis the actual concurrency guard; cross-process protection (two schedulers on one workspace) relies on operators not running multiple concurrent schedulers AND on the TTL being well above the longest plausible COPY (24 h default). Documenting the residual risk so it isn't masked by a misleading "we're safe" comment (Devin Review on extractor.py:111). agnes pullnow re-downloads parquets when the local file is missing, even if the recorded hash matches the server. Pre-fix the download set was computed fromsync_state.jsonhash equality alone — if the parquet had been deleted (manualrm, disk cleanup, a different workspace sharing the same global~/.config/agnes/sync_state.jsonwriting one workspace's parquets while another reads sync_state and assumes "I already have these"), the hash-equal check would short-circuit the download and the next DuckDB view rebuild would fail on a missing file. Now the existence check on<workspace>/server/parquet/<tid>.parquetruns alongside the hash compare; missing file → forced re-download regardless of hash.agnes query --remoteno longer over-rejects narrow queries on partitioned/clustered BigQuery tables. Closes #171. Pre-fix the/api/querycost guardrail dry-ran a syntheticSELECT * FROM <table>per registered remote-BQ row referenced by the user SQL, which forced BQ to estimate "full table scan" — column projection, predicate pushdown, and partition pruning were all ignored, producing scan-byte estimates up to ~30,000× larger than the actual query would scan. Narrow queries on big partitioned tables (the documented happy-path use case) were rejected with 400remote_scan_too_largeeven when BQ's own dry-run reported single-digit MB. Now the guardrail rewrites the user SQL from DuckDB-flavor (bare registered names +bq."<ds>"."<tbl>") to BQ-native (`<project>.<ds>.<tbl>`) and runs ONE dry-run on the EXACT user SQL — partition pruning, column projection, and predicate pushdown all engage. Cap check uses the real estimate. Fallback: if BQ rejects the rewritten SQL withbq_bad_request(DuckDB-only syntax that doesn't translate, e.g.::INTcasts), the guardrail falls back to the pre-fix per-table SELECT * estimate so a non-portable query still gets bounded; non-parse errors (forbidden / upstream) propagate as 502. Helpers exported as_rewrite_user_sql_for_bq_dry_run(test seam).- Windows:
agnesCLI no longer crashes on cs-CZ / non-UTF-8 consoles. Two failure modes addressed (originally reported in #172 against the pre-renamedaCLI; ported and broadened here): (1)agnes pulland any other Rich-progress-bar codepath crashed withUnicodeEncodeErrorbecause cp1250 / cp1252 cannot encode Rich's Braille spinner glyphs —cli/main.pynow reconfiguressys.stdout/sys.stderrto UTF-8 witherrors="replace"at import time whensys.platform == "win32". (2)agnes skills listandagnes skills showcrashed withUnicodeDecodeErrorreading skill markdown that contains em-dashes / accents — everyPath.read_text()/Path.write_text()/open()call site incli/(including ones not touched by #172, since several files were renamed in the bootstrap rewrite) now passesencoding="utf-8"explicitly. Defensive: also covers JSON / YAML config files that were ASCII-only in practice but were one non-ASCII value away from the same failure mode. agnes snapshot create … --estimatein a pre-init directory no longer leaks an httpxConnectErrortraceback to stderr. The estimate-guard fix (3d587681) let--estimatereachapi_post_json, but the existingexcept V2ClientErrorclause didn't catch transport-layer errors when no server was configured (defaulted tohttp://localhost:8000). Now also catcheshttpx.HTTPErrorand renders the friendly hintRun \agnes init …` first`.agnes pushnow reads Claude Code session jsonls from~/.claude/projects/<encoded-cwd>/(where Claude Code actually writes them), instead of<workspace>/user/sessions/(which the SessionEnd hook never populated — the previous code uploaded an empty list every time). Encoding logic incli/lib/claude_sessions.pyprobes both Claude Code variants — older/→-and newer all-non-alphanumeric→-— and unions the result, so users who have upgraded Claude Code mid-project see sessions from both encoded dirs. Falls back to<workspace>/user/sessions/for back-compat.
Removed
da analyst setup,da analyst status,da sync,da fetch,da metrics. See Changed for replacements.da metricsnamespace as a top-level group (subcommands moved toagnes catalog --metricsfor read-only views andagnes admin metrics …for write operations).- Legacy workspace directories
data/parquet/,data/duckdb/,data/metadata/,user/artifacts/. Existing analyst workspaces should be reinitialized withagnes init --server-url ... --token ... --force(a fresh empty folder is recommended). _resolve_analyst_lines,_analyst_init_lines,_analyst_finale_lineshelpers inapp/web/setup_instructions.py— the analyst-vs-admin layout split is gone.roleparameter oncompute_default_agent_prompt,resolve_lines, andrender_setup_instructions.?role=query parameter on/setup. Admin tile (<nav class="role-tiles">) andROLEJS const + role-aware PAT-mint ternary ininstall.html.
Internal
cli/lib/__init__.py(empty) makescli/lib/a proper package picked up by Hatchling for wheel inclusion..gitignoreallowlistscli/lib/from the genericlib/rule.tests/fixtures/analyst_bootstrap.py— reusable test fixtures (fastapi_test_server,web_session,test_pat,test_pat_no_grants,zero_grants_workspace,NONEXISTENT_TABLE) for clean-install verification.tests/test_reader_smoke_matrix.py— load-bearing parametrized test: every reader CLI command runs on a freshly-bootstrapped zero-grants workspace without a Python traceback.tests/test_clean_install_integration.py— end-to-end happy-path tests (minimal grants, zero grants, force preserves CLAUDE.local.md, readers in pre-init dir).docs/RELEASE_CHECKLIST.md— manual clean-install protocol mandated for any PR touching the bootstrap path.- Audited and replaced stale
daverbs left over from prior merges in admin UI text, audit-log messages, code comments, operator runbooks, analyst-facing skill docs, and test docstrings (welcome template renderer/API tests now assert exact emitted markers —agnes initfor analyst flow,agnes authfor admin flow — with explicit absence checks on legacy verbs). Vendor-specific/opt/data-analyst/install paths in jira backfill/consistency scripts and operator docs replaced with<install-dir>/and anAGNES_ENV_FILEenv-var override. Intentional stale-marker tuples (_LEGACY_STRINGSinapp/api/claude_md.py,_OUR_COMMAND_MARKERSincli/lib/hooks.py) and tests that seed legacy hook content (tests/test_lib_hooks.py,tests/test_legacy_strings_scan.py) are preserved by design.
[0.33.0] — 2026-05-04
Closes #162. Headline fix: query_mode='materialized' BigQuery rows now
materialize correctly for views and materialized views, with per-table
concurrency control preventing parquet corruption on overlapping scheduler
ticks. Plus a source_query server-generation convenience, a
materialize.lock_ttl_seconds config knob, and a schema v24 migration that
converts existing DuckDB-flavor source_query values to BQ-native SQL.
Fixed
- BigQuery materialize now works for views and materialized views. Pre-fix,
materialize_queryran admin'ssource_queryasCOPY (sql) TO parquetthrough the DuckDB BigQuery extension session, which routed through the BQ Storage Read API forbq."<ds>"."<tbl>"references. Storage Read API rejects non-base entities (Binder Error: Error while creating read session: ... non-table entities cannot be read with the storage API). Fixed by always wrapping admin SQL intobigquery_query('<billing-project>', '<inner-sql>')so COPY uses the BQ jobs API uniformly for tables, views, and materialized views. materialize_queryno longer corrupts its parquet under concurrent invocations for the sametable_id. Pre-fix, two overlapping_run_materialized_passcalls (e.g. a long-running COPY + the next scheduler tick) both hit the unconditionalif tmp_path.exists(): tmp_path.unlink()at function entry and started parallel COPYs against the same path, interleaving bytes and producing a parquet file with no valid footer. Now each call acquires a per-table_idthreading.Lockplus an advisoryfcntl.flockon<id>.parquet.lock; the second caller raisesMaterializeInFlightErrorand the scheduler treats it asskipped, in_flight— never as an error.- Cost guardrail dry-run now engages for materialized rows. Pre-fix, the
BigQuery Python client returned 400 (
Table-valued function not found: bigquery_query) on the wrapped SQL and the dry-run silently fail-opened. The dry-run now operates on the inner BQ-native SQL (admin'ssource_querydirectly), which the client parses cleanly.
Changed
- BREAKING
query_mode='materialized'rows MUST registersource_queryas BigQuery-native SQL (backticks for dashed identifiers, native joins/CTEs). DuckDB-flavor (bq."<ds>"."<tbl>") is no longer accepted on register/PUT. The schema v24 migration converts existing rows automatically; operators with custom-writtensource_queryshould review the migrated form on first deploy. The validator's prior backtick-rejection rule is now scoped toquery_mode IN ('remote', 'local')only. _run_materialized_passsummaryskippedfield changes fromlist[str]tolist[dict]with shape{"table": str, "reason": Literal["due_check", "in_flight"]}. Downstream consumers that asserted the old string form must update.
Added
POST /api/admin/register-tableforquery_mode='materialized'rows withbucket+source_tablebut nosource_querynow server-generatesSELECT * FROM `<project>.<bucket>.<source_table>`from the configured BigQuery project. The same fallback fires onPUT /api/admin/registry/{id}when flipping to materialized. Operators only need to knowbigquery_query()semantics for non-trivial queries.- New top-level
materializeconfig section ininstance.yaml. Single field —materialize.lock_ttl_seconds(default86400, 24 h) — controls how long a stale<id>.parquet.lockfile lives before a sibling materialize attempt reclaims it. Editable via/admin/server-configAPI and UI.
Internal
- Schema v24 migration: rewrites
table_registry.source_queryfor materialized BigQuery rows from DuckDB-flavor (bq."<ds>"."<tbl>") to BQ-native (`<project>.<ds>.<tbl>`) using the configured BQ project. Idempotent on already-converted rows; logs a warning and skips when the project isn't configured (operator can configure + restart for retry). Wrapped inBEGIN TRANSACTION/COMMITto match the project's transactional-finalizer pattern. connectors/bigquery/extractor.pyexportsMaterializeInFlightErrorand the_get_table_lock/_get_lock_ttl_seconds/_wrap_admin_sql_for_jobs_api/_escape_sql_string_literalhelpers as test seams. Underscore-prefixed; not part of the public API.tests/conftest.pyliftsbq_instanceandstub_bq_extractorfixtures fromtests/test_api_admin_materialized.pyso subsequent test modules in this PR can resolve them via pytest's auto-discovery.app/api/sync.py:is_table_duehoisted to module-level import (was deferred inside_run_materialized_pass) so monkeypatchingapp.api.sync.is_table_dueactually intercepts the call — the deferred form made test patches a no-op.
[0.32.0] — 2026-05-04
Closes #160. Headline fix: da query --remote now resolves
query_mode='remote' BigQuery rows whose underlying entity is a VIEW
or MATERIALIZED_VIEW. Plus four reinforcing fixes that surfaced during
the work — server-side cost guardrail, registry-gating of direct bq.*
paths, function-call backdoor closed, structured CLI error rendering —
and one operator-side admin convenience (BQ test-connection endpoint +
billing_project placeholder UI). 14 issues caught + fixed across 6
iterations of Devin Review.
Added
/admin/server-configBQ test connection: admin-onlyPOST /api/admin/bigquery/test-connectionruns a 10s-timeoutSELECT 1against BigQuery via the process-cachedBqAccess(@functools.cacheonget_bq_access) and returns typed structured feedback (200 ok/400 not_configured/502 cross_project_forbidden/504 timeout). Tests the config active in the running process — after adata_source.bigquerysave the response shape includesrestart_required: True; click "Test connection" AFTER restart to validate the freshly-saved values. The /admin/server-config UI gets a "Test BigQuery connection" button next to the data_source Save button; on failure the inline result uses the same structured shape as the CLI renderer so operators see the same hint format admins do.data_source.bigquery.bq_max_scan_bytesserver-config knob (default 5 GiB): caps the BigQuery scan thatda query --remotewill issue againstquery_mode='remote'BQ rows. Exceeded queries are rejected with a structured400 remote_scan_too_largedetail naming the bytes, tables, and ada fetchsuggestion. Quota usage is recorded against the same daily byte cap as/api/v2/scan.data_source.bigquery.billing_projectplaceholder UI: the admin form now shows(defaults to <project>)greyed under an empty billing_project input, surfacing the access.py:339-340 fallback rule directly in the UI.
Fixed
da query --remoteagainstquery_mode='remote'BigQuery rows whose underlying entity is aVIEWorMATERIALIZED_VIEWnow resolves correctly (issue #160). The BQ extractor creates a master view via the catalog path (bq."<dataset>"."<source_table>") forBASE TABLE(Storage Read API; predicate pushdown) and viabigquery_query()forVIEW/MATERIALIZED_VIEW(jobs API). Other BQ entity types (EXTERNAL,SNAPSHOT,CLONE) are logged + skipped at extraction with no_metarow, so the orchestrator doesn't strand a registered name with a non-existent inner view.- Direct
bq."<dataset>"."<source_table>"references in/api/queryare now registry-gated: unregistered paths return 403bq_path_not_registered; registered paths are subject to the same per-name grant check as registered names. Closes a pre-existing RBAC bypass where direct catalog-path syntax skipped the master-view forbidden-table check entirely. Quoted catalog tokens ("bq"."ds"."tbl") are caught by the same regex. bigquery_query()direct calls in user SQL are now blocked by the/api/querykeyword blocklist. Closes a pre-existing function-call bypass that ran arbitrary BQ jobs API calls against any reachable dataset, ignoring the registry. Wrap views internal to the BQ extractor still usebigquery_query()inside theirCREATE VIEWbody — those run via DuckDB's view resolution at query time, never via user-submitted SQL, so the blocklist doesn't break them.- CLI commands (
da query --remote,da query --register-bq,da fetch,da schema, etc.) pretty-print structured BigQuery errors —cross_project_forbidden,bq_forbidden,auth_failed,not_configured,remote_scan_too_large,bq_path_not_registered, etc. — instead of dumping the truncated JSON body. The hint that explains how to fixUSER_PROJECT_DENIED(setdata_source.bigquery.billing_projectin /admin/server-config) is now actually visible to the operator. /api/query/hybridnow returns dictdetailfor typed errors (was flattening tof"BQ '{alias}': {error_type}: {message}"), so the new CLI renderer surfaces the structured shape consistently across both endpoints.
Changed
- BREAKING (config-only):
data_source.bigquery.legacy_wrap_viewsremoved. The flag was opt-in for the wrap-view behavior that is now the default. Keys still present in operator overlays are silently ignored — no action required. Operators who previously setlegacy_wrap_views: false(the prior default) get the new behavior for VIEW / MATERIALIZED_VIEW rows: a master view is created (via the BQ jobs API), andda query --remoteworks against the registered name. The cost concern that motivated the prior default is now addressed by the server-side guardrail (see Added). - Quota tracker relocated:
_build_quota_trackerand_quota_singletonmoved fromapp/api/v2_scan.pytoapp/api/v2_quota.py(their natural home).v2_scan.pyre-exports the function for backwards compat; existing test sites that callv2_scan._build_quota_tracker()keep working.
[0.31.0] — 2026-05-04
Added
- Agent Workspace Prompt — admin-editable Jinja2 markdown template for the analyst's
CLAUDE.md, surfaced in their workspace byda analyst setup. Default = rich briefing with RBAC-filtered tables/metrics/marketplaces context. Edit at/admin/workspace-prompt. Endpoints:GET /api/welcome(analyst-facing, auth required),GET/PUT/DELETE /api/admin/workspace-prompt-template,POST /api/admin/workspace-prompt-template/preview. CLI:da analyst setupwritesCLAUDE.mdby default; new--no-claude-mdflag opts out. Seedocs/agent-workspace-prompt.md. - Agent Setup Prompt — customizable bash setup script shown on
/setupand copied by the dashboard clipboard CTA. Default = the livesetup_instructions.resolve_lines()output (TLS trust bootstrap, CLI install, login, marketplace, skills). Admin override at/admin/agent-prompt— full replacement of the default, not a banner added on top. Override flows to both the/setuppage display and the dashboard clipboard payload. Jinja2 is available for{{ instance.name }}etc.;{server_url}and{token}are JS-substituted at clipboard-copy time and survive Jinja2 rendering unchanged. REST API:GET /api/admin/welcome-templatereturns{content, default, updated_at, updated_by}(contentisnullwhen no override is set;defaultis always the live computed script);PUTto set an override;DELETEto clear;POST /api/admin/welcome-template/previewfor live preview without persisting. Available Jinja2 placeholders:instance.{name,subtitle},server.{url,hostname},user(may benullfor anonymous visitors),now,today. Override content is HTML-sanitized post-render (script/iframe/event-handler strip). Seedocs/agent-setup-prompt.md. - DuckDB schema v21:
welcome_templatesingleton table backing the Agent Setup Prompt override. Auto-migration v20→v21 on first start. - DuckDB schema v22:
setup_bannertable reserved (no consumers; retained for forward compatibility with already-migrated instances). - DuckDB schema v23:
claude_md_templatesingleton table backing the Agent Workspace Prompt override. Auto-migration v22→v23.
Changed
da analyst setupwritesCLAUDE.mdto the analyst workspace from the server-rendered template (fetched viaGET /api/welcome). Use--no-claude-mdto opt out. Analysts who ran setup while CLAUDE.md generation was temporarily absent will have their file written on the nextda analyst setuprun./installpage renamed to/setup("Setup local agent" nav label) with 302 redirect from/install.- Dashboard "What Claude Code will receive" inline preview replaced with a link to
/setupfor the canonical view.
Fixed
da analyst setupsummary now accurately reflects whetherCLAUDE.mdwas written, skipped (--no-claude-md), or skipped due to a server error — previously it always claimed "written from server template" even when the fetch failed (404, 401/403, network), contradicting its own stderr warning.
[0.30.1] — 2026-05-02
Security
- auth: per-IP rate limiting now applied across every credential-bearing
auth endpoint. Defaults:
- 10/minute —
POST /auth/token,POST /auth/password/login,POST /auth/password/login/web(login brute-force throttle). - 10/minute —
POST/GET /auth/email/verify,POST /auth/password/reset/confirm,POST /auth/password/setup/confirm,POST /auth/password/setup(JSON variant — without it, the form/setup/confirmthrottle is bypassable by switching to the JSON path) (token brute-force throttle: the 32-byte URL-safe tokens are high entropy but partial leaks via logs / proxy referer have surfaced before, and there's no reason to allow unbounded guessing). - 5/minute —
POST /auth/email/send-link,POST /auth/password/reset,POST /auth/password/setup/request(email-bombing throttle: same shape on all three — attacker rotates random recipient addresses from a single IP to burn SMTP/SendGrid quota and spam real users; anti-enumeration responses mask which addresses landed). - 3/minute —
POST /auth/bootstrap(one-shot in normal use). Returns429withRetry-After: 60once exceeded. Per-IP key uses the leftmostX-Forwarded-Forhop — same trust model asapp.auth.dependencies._client_ip(Caddy strips client-supplied XFF in front of the app). SetAGNES_AUTH_RATELIMIT_ENABLED=0in env and bounce the container to disable (no image rebuild required; the value is read at process start, matching every other Agnes env knob). New dependency:slowapi>=0.1.9. Closes #45.
- 10/minute —
- admin API:
DELETE /api/admin/users/{id}/memberships/{group_id}andDELETE /api/admin/groups/{group_id}/members/{user_id}now refuse to remove anyone from the seededAdmingroup when they are the only remaining active admin — previously the guard only fired on self-removal, leaving a path where an admin could demote the only other admin and then rely on the partial guard to (correctly) block self-removal, but a scheduler / bootstrap path that bypasses normal admin checks could still reduce active admins to zero. Recovery from zero admins requires direct DB access, so the guard generalizes to mirror the existingcount_admins(active_only=True) <= 1check onDELETE /api/admin/users/{id}andPATCH /api/admin/users/{id}(active=false). Closes #151.
Fixed
- admin API:
POST /api/admin/register-tableandPUT /api/admin/registry/{id}now rejectsource_querycontaining BigQuery-native backtick identifiers (e.g.`prj.ds.t`) with HTTP 422 and a message pointing operators at the DuckDB-flavor equivalent (bq."dataset"."table"). Backtick SQL would silently no-op at the next materialize tick — the BQ extension's COPY runs through DuckDB's parser, which doesn't recognize backticks, so the query either parse-errored or matched zero rows and no parquet ever landed at/data/extracts/<source>/data/<id>.parquet. Fix catches the bad SQL at registration time so the row never lands in the registry. - admin API:
DELETE /api/admin/registry/{id}now removes the canonical materialized parquet (${DATA_DIR}/extracts/<source_type>/data/<name>.parquetplus any stale.parquet.tmp) AND clears the matchingsync_state/sync_historyrows. Pre-fix the registry row was dropped but the parquet- sync_state row stayed, so
GET /api/sync/manifestkept advertising the dropped table toda syncand analysts kept downloading it. Defensive failure handling — file-removal errors are logged but don't fail the DELETE.
- sync_state row stayed, so
Added
- admin API:
GET /api/admin/registryenriches each table row withlast_sync_error(string or null) sourced fromsync_state.error. The scheduler's_run_materialized_passnow writes per-row failures viaSyncStateRepository.set_errorso cap-exceeded / auth-failure / bad-SQL errors surface to the admin UI andda admin statusinstead of vanishing into scheduler stderr. A row that recovers on the next tick clears the error automatically (the success path ofupdate_syncresetsstatus='ok'/error=NULLon the upsert). - admin API:
POST /api/admin/register-tablenow refuses requests whosesource_typeisn't actually configured on the instance — pre-fix, an admin could registersource_type='keboola'on a BQ-only instance and the row would land in the registry but never sync (no Keboola URL/token to ATTACH against). Returns 422 with a message naming the configured primary source and pointing at/admin/server-configfor enabling a secondary source.jira/localare exempt — they don't sit underdata_source.*. Omitted source_type still tolerated for legacy CLI callers. Stays permissive when primary is'local'(bootstrap workflow — instance not yet pointed at a real source). - query API:
POST /api/querynow returns a materialize-aware error when the failed SQL references a table id that's registered withquery_mode='materialized'but doesn't yet exist as a master view in this instance'sanalytics.duckdb(e.g. fresh instance, no scheduler tick yet). The hint names the table, points atda sync/POST /api/sync/trigger, and — when the registry row carries a bucket+source_table — surfaces the equivalent direct-source query (bq."dataset"."table"orkbc."bucket"."table") so the operator has a concrete next step. Falls back to DuckDB's raw error for non-materialized unknowns.
Internal
- tests: refresh
docker-e2ehealth asserts to match the current/api/healthshape (auth-free, returnsstatus+db_schemaonly).versionmoved to/api/versionin 0.10-era refactor; richerservices.duckdb_statelives in/api/health/detailed(auth-gated). Tests had drifted and broke nightly e2e on main.
[0.30.0] — 2026-05-01
Added
- admin UI: each row in
/admin/tableslistings now has a per-row Manage access icon button (between Edit and Delete) that deep-links to/admin/access#table:<table_id>. The grant editor reads the hash on load and pre-fills the resource filter so the operator lands on the picked table once they select a group — shortcut for the common "I just registered table X, who should see it?" workflow without manual navigation through the resource tree. - docs:
config/instance.yaml.exampledocuments every field newly exposed by/admin/server-config—data_source.bigquery.billing_project(with the USER_PROJECT_DENIED hint),data_source.bigquery.legacy_wrap_views,data_source.bigquery.max_bytes_per_materialize,ai.base_url,openmetadata.*,desktop.*, and the fullcorporate_memory.*block. Each cross-references the admin UI so operators discover the editor exists. - diagnostics:
/api/health/detailed(and thereforeda diagnose) now surfaces abq_configservice entry on BigQuery instances. Reportsstatus="warning"whendata_source.bigquery.billing_projectresolves equal todata_source.bigquery.project— the configuration where a service account withroles/bigquery.dataVieweron the data project but noserviceusage.services.use403s every BQ call with USER_PROJECT_DENIED. The warning includes a hint pointing at theinstance.yamlfield and the/admin/server-configUI. - admin UI:
/admin/server-configexposes the full corporate_memory governance schema in the editor —distribution_mode,approval_mode,review_period_months,notify_on_new_items, thesources/extraction/confidence/contradiction_detection/entity_resolutionnested objects, plus thedomain_owners/domainslists. The whole section is optional (omitted = legacy democratic-wiki mode); admins can opt in via the UI without hand-editing YAML. Schema mirrorsconfig/instance.yaml.examplelines 224-317.confidence.modifiers(map<string, map<string, float>>) currently renders as a JSON-textarea fallback with the schema explained inline — full structured editor is a TODO. - admin UI: server-config renderer learned three new shapes —
kind="array"with a scalaritem_kindrenders as a vertical stack of typed inputs with +/- row controls;kind="map"with scalarvalue_kindrenders as key:value rows with +/- controls;value_kind="array"inside a map renders the value column as a comma-separated list (pragmatic compromise over a full nested-array UI inside each map row). Leaf inputs now carrydata-path(JSON-encoded segment array) so map keys with embedded dots — e.g.confidence.base["user_verification.correction"]— survive round-trip without being mistaken for nested-path separators. - admin UI:
/admin/server-configrenders registry-declared nested fields (kind="object"with explicitfields) as a fully-editable structured form — every leaf is its own input with a dotted-pathdata-key, and the collector rebuilds a nested patch on save. Replaces the previous read-only preview that forced operators to edit a parent JSON textarea. YAML-only keys outside the registry survive via an "Other (YAML-only) keys" expander per nested layer. Recursion handles arbitrary depth, ready for the upcoming corporate_memory + admins registry entries. - admin UI:
/admin/server-confignow ships a known-fields registry (_KNOWN_FIELDSinapp/api/admin.py, exposed on the GET response asknown_fields). The renderer shows registry-declared knobs as dashed placeholders alongside populated values, with a one-line hint per field, so operators discover optional config (e.g.data_source.bigquery.billing_project) directly in the UI instead of having to read docs or hit a runtime error first. Subagents 2-4 will populate the bodies; the smoke fixture coversbigquery.billing_project. - admin UI:
/admin/server-confignow exposes three previously YAML-only BigQuery knobs in the editor —data_source.bigquery.billing_project,legacy_wrap_views, andmax_bytes_per_materialize. The GET response always includes them underdata_source.bigquery(with documented defaults when YAML omits them) so the JSON-textarea UI shows them as editable keys. The section help text describes each. Operators no longer need to SSH to the VM, edit YAML, restart to flip these. - admin UI:
/admin/tablesis now a per-connector tab interface (BigQuery / Keboola / Jira). Each tab has its own Register modal + listing scoped to its source_type. Active tab persists inwindow.location.hashso refresh keeps the operator in place. - Keboola materialized SQL:
query_mode='materialized'now works forsource_type='keboola'— admin registers a SELECT againstkbc."bucket"."table"and the scheduler writes the result to/data/extracts/keboola/data/<id>.parquet. Same flow as BigQuery materialized; sameda syncdistribution; same RBAC. Cost guardrail (BQ-style dry-run) intentionally omitted — Keboola extension has no dry-run analog and Storage API cost is download-byte-shaped, not scan-byte-shaped. A future PR can add a configurable byte cap if operators ask for it. - Keboola Sync Schedule: per-table cron input added to the Keboola
tab Register and Edit modals. The scheduler has always honored
per-table
sync_schedulefor every source viais_table_due(), but the Keboola UI had no surface for it — operators had to use the/api/admin/registry/{id}PUT endpoint orda adminCLI. Now they can typeevery 6h/daily 03:00directly. - BigQuery
query_mode='materialized'— admin registers a SQL query viada admin register-table --query-mode materialized --query @file.sql --sync-schedule "every 6h"; the sync trigger pass runs it through the DuckDB BigQuery extension via theBqAccessfacade on each tick that's due (per-tablesync_schedulehonored viais_table_due()) and writes the result to/data/extracts/bigquery/data/<name>.parquet. The manifest endpoint exposes the row toda sync, which distributes the parquet to analysts; analysts query it through their local DuckDB view. The server-side orchestrator does not create a master view for materialized tables — they are intentionally local-only for analyst distribution, mirroring the v2 fetch primitives' "queryable viada fetchnot via remote" contract. Per-user RBAC filtering is unchanged: a materialized table is just another row intable_registrywithresource_grantscontrolling which groups see it. - Schema v20 adds
source_query TEXTcolumn totable_registryto back the materialized mode. NULL for existing rows. Thematerialize_query()function in the BigQuery extractor performs the COPY atomically (<id>.parquet.tmp→os.replace) so a failed query never leaves a half-written parquet. - BigQuery cost guardrail for
query_mode='materialized'tables: before each COPY the scheduler runs a BQ dry-run (reusingapp.api.v2_scan._bq_dry_run_bytesso cost-estimate logic lives in exactly one place) and raisesMaterializeBudgetError(skips the row) when the estimate exceedsdata_source.bigquery.max_bytes_per_materialize. Default 10 GiB; explicit0disables (YAMLnullfalls through to the default — documented inconfig/instance.yaml.example). Fail-open when the dry-run itself errors (library missing, DuckDB three-part syntax the native BQ client can't parse, transient API failure) — logs a warning instead of blocking the COPY. - Admin API:
POST /api/admin/register-tableandPUT /api/admin/registry/{id}acceptsource_queryfield. Validator enforces thatquery_mode='materialized'requiressource_queryandquery_mode in ('local', 'remote')forbids it. PUT also rejectssource_queryset withoutquery_modein the same request body and clears the stalesource_querywhen switching the merged record away from materialized mode. - CLI:
da admin register-table --query <SQL>accepts inline SQL or@path/to.sqlshorthand for reading from disk. Reuses the existing--sync-scheduleflag for the cron string. da sync --quietflag suppresses Rich progress + multi-line summary, intended for use from Claude Code SessionStart/SessionEnd hooks and cron jobs. Errors still surface on stderr; the no-op case is silent. The terse summary line in--quietmode (sync: N tables, M errors) lands on stderr so stdout stays clean for hook callers.da analyst setupnow installsSessionStart(pull) andSessionEnd(upload) hooks into<workspace>/.claude/settings.json, idempotently, preserving any existing user-owned hooks. Workspace-level (not user-home) so the hooks fire only when Claude Code is opened in the analyst workspace, not in unrelated sessions on the same machine. Hooks assumedais onPATH. If the CLI is not installed system-wide (e.g. viapipxorpip install -e .), the hooks no-op silently — expected graceful degradation, never blocks a session.docs/setup/claude_settings.jsonships the same two hooks so operators bootstrapping a fresh Claude Code workspace get auto-sync out of the box.
Changed
- admin UI: Keboola Register and Edit modals adopt the same
two-question radio model as BigQuery — What to sync? (Whole table
/ Custom SQL). Whole-table mode synthesizes a
SELECT *and writes it through the materialized path; Custom mode lets the admin filter / aggregate / project. The legacyquery_mode='local'extractor path remains supported for back-compat but is no longer the default for new Keboola registrations — Whole mode is functionally equivalent and follows the unified materialized pipeline. - admin UI:
Sync Strategydropdown removed from the Keboola form (Register and Edit). Two independent agent reviews (2026-05-01) found the field's hint claimed it controlled extraction but no extractor reads it; onlyprofiler.is_partitioned()consumes it for parquet- layout detection. Field stays in the DB and Pydantic model for back-compat (markedField(deprecated=True)); just hidden from the primary form. - admin UI:
Primary Keyinput moved under<details>Advancedin both Keboola Register and Edit modals, with a clarifying hint that it's catalog metadata only — Agnes always does full-overwrite sync; no upsert / dedup. Auto-fill from Keboola discovery still works. - admin UI: Registry listing column "Strategy" replaced with "Mode"
(showing
query_modeinstead of decorativesync_strategy). The.col-strategy/.strategy-badgeCSS rules removed. - BigQuery
init_extractno longer creates remote views for rows withquery_mode='materialized'; those live as parquets and surface via the orchestrator's standard local-parquet discovery. Skipped rows do not appear in_metaso cross-source view-name collisions remain impossible.
Deprecated
RegisterTableRequest.sync_strategy— catalog/profiler metadata only; no extractor reads it. MarkedField(deprecated=True). External API consumers see the signal in OpenAPI; back-compat preserved.RegisterTableRequest.profile_after_sync— runtime never read this flag (Agent 1 finding 2026-05-01); profiler runs unconditionally on every synced table. MarkedField(deprecated=True)and made inert (the BQ register endpoint no longer force-sets it toFalse). Back-compat preserved — external clients sending the field get no error, no warning, no effect.
Fixed
- admin API:
update_tablePUT preservessync_strategyandprimary_keywhen the Edit modal omits them from the payload (this invariant always held viarequest.model_dump()+if v is not None, but Phase I now has an explicit regression-guard test). docs/setup/claude_settings.jsonno longer references the deletedserver/scripts/collect_session.py— the deadSessionEndhook had silently failed in every Claude Code session since the v1→v2 server purge. Replaced withda sync --upload-only --quiet.
Internal
- README mode-first source table; new "Local sync & auto-update" section
covering
da sync, hooks, and admin RBAC for auto-sync membership. CLAUDE.mdschema chain extended through v20 with thesource_querydescription; four source modes documented in Connector Pattern (added Materialized SQL); new "Local sync & Claude Code hooks" subsection under Development.cli/skills/connectors.md— "BigQuery: pick a mode" decision table with cost / guardrail / registration example.docs/architecture.md— new "BigQuery — Materialized SQL" subsection describing the COPY pipeline, BqAccess integration, and cost guardrail.- BQ cost guardrail dry-run is performed via the native
google-cloud-bigqueryclient (throughBqAccess.client()), which does not parse DuckDB three-part identifiers (bq."ds"."t"). Queries written in DuckDB syntax fall through fail-open and log a warning instead of engaging the cap. Operators who need the cap to be enforceable must register the materialized SQL using native BQ identifiers (\project.ds.t``). - Hardenings landed during devil's-advocate review of PR #145:
materialize_querycomputes the parquet MD5 inline (after COPY, beforeos.replace) instead of re-reading the file in_run_materialized_pass— saves a full sequential read on the request thread for multi-GB parquets.- 0-row materializations log a
WARNINGso an empty result set can't masquerade as "the SQL is fine, today there's nothing". - The ATTACH-tolerated
except duckdb.Error: passis narrowed to the "alias already attached" case; real errors (cross-project permission, malformed project_id) propagate so the per-row aggregator records them correctly instead of surfacing a confusing downstream "bq is not attached".
Known limitations
Operators should be aware of these production-only behaviours; tests cannot exercise them and they will be revisited in follow-up PRs:
- GCE metadata token expiry mid-COPY (catastrophic for very long
scans). The DuckDB BQ extension caches the token in a session
SECRET created at session-open. A
materialize_querycall that takes longer than the token's remaining lifetime (~1h) will see silent 401s downstream and may produce a truncated parquet. No current mitigation; if your materialized SQL scans more than ~30 GiB on a single COPY, run it via the BQ console / Storage Read API offline andda fetchthe result instead until token refresh is wired into the BQ extension's session. - DuckDB
bigquerycommunity extension is unpinned —INSTALL bigquery FROM community; LOAD bigquery;picks up the latest published version on every cold start. A breaking change upstream surfaces as a production failure with no test signal. - Schema drift after a SQL edit silently breaks analyst queries.
Editing
source_queryto drop a column writes a new parquet with the new shape; analysts' queries that referenced the dropped column 500 on the next sync without warning. No diff or version field surfaces this. Workaround: announce changes in the team channel before editing materialized SQL. materialize_queryis not concurrency-locked. Two concurrent/api/sync/triggercalls for the same materialized row race on<id>.parquet.tmp.init_extracthas_INIT_EXTRACT_LOCKfor the remote-attach path, but the materialized path does not yet. In practice: the cron scheduler is single-threaded and manual triggers are rare, so the race window is small.
[0.29.0] — 2026-05-01
Fixed
scripts/ops/agnes-tls-rotate.shself-signed fallback cert now setsbasicConstraints=critical,CA:FALSEon the leaf. OpenSSL's default[v3_ca]config marksCA:TRUEonreq -x509, which causes strict TLS stacks (rustls /webpki, used byuv,cargo, and future versions ofpip) to reject the cert withinvalid peer certificate: CaUsedAsEndEntityper RFC 5280 §4.2.1.9. Browsers, curl, and OpenSSL-based clients tolerated the violation, hiding the bug until auvuser hit it. Affects every VM running on the self-signed fallback while the corp PKI hasn't published the real chain yet — the fix lands on the nextagnes-tls-rotate.timertick (orsystemctl start agnes-tls-rotate.servicefor an immediate refresh). Existing CSR / real-cert paths unaffected; only the bring-up fallback regenerates.
[0.28.0] — 2026-05-01
Fixed
- Analyst CLAUDE.md template now documents BigQuery remote-query capability.
config/claude_md_template.txt(used byda analyst setup) had zero mention ofquery_mode: "remote",da fetch,da query --remote, or--register-bq— the AI analyst running in a freshly-bootstrapped workspace had no idea remote tables existed. Added a## Remote Queries (BigQuery)section covering: discovery viada catalog(now called out as canonical, withdata/metadata/schema.jsonflagged as local-only); the three query patterns (da fetchpreferred,da query --remotefor one-shots,da query --register-bqfor hybrid joins); permission boundary (BQ access via the agnes server's GCE service account, not personal creds — escalate permission errors to admin); cost awareness (every query bills the SA's project for bytes scanned,--select/--where/--estimatediscipline);da fetchestimate-first rules; BigQuery SQL flavor reminder; snapshot freshness ritual (da snapshot drop+ re-fetch when source data updates); concrete hybrid-query example with--register-bqjoining local + ad-hoc BQ; the unknown-table case (ad-hoc--register-bqor ask admin to register); and a cross-reference toda skills show agnes-data-queryingfor deeper guidance. Also clarifies that personal customizations belong in.claude/CLAUDE.local.md, not CLAUDE.md (which is regenerated byda analyst setup --forceand would lose edits). Closes #153.
Removed
- Legacy
docs/setup/claude_md_template.txtdeleted. 359-line stale template that documented the deprecated SSH-heredoc remote-query protocol (ssh data-analyst 'bash ~/server/scripts/remote_query.sh --stdin' < query.json). The active template lives atconfig/claude_md_template.txt; the docs/ copy was confusing references and at risk of being pulled into a workspace by a future refactor. No code references the deleted file (verified).
[0.27.0] — 2026-04-30
Removed
- BREAKING Table access fully migrated to per-group
resource_grants(ResourceType.TABLE). Existingdataset_permissionsrows are dropped on upgrade — admins must re-grant via/admin/access. Wildcard bucket grants (bucket.*) no longer supported and not replaced: every table needs an explicit grant (or admin override). Per-table bulk action in/admin/accesscovers a whole bucket at once. - BREAKING
table_registry.is_publiccolumn dropped. The bypass shortcut had no API/UI/CLI surface to set it (only direct DB UPDATE worked) so the legacy data-RBAC layer was de-facto inactive — every table was implicitly public. Post-upgrade non-admin users see zero tables until admin grants explicit access. Migrate by minting the relevantresource_grants(group, "table", id)rows in/admin/accessbefore deploy or immediately after. - BREAKING Self-service
access_requestsflow removed (table, repository,/api/access-requests/*endpoints, "Request Access" catalog modal). Users contact admin out-of-band; admin grants via/admin/access. - BREAKING Legacy
users.rolecolumn dropped (NULL artifact since v13). API contracts:CreateUserRequest.role,UpdateUserRequest.roleremoved;UserResponse.rolebecomes a derived"admin"|"user"label. CLI:da admin set-roleremoved (hard-fail with a replacement command),--roleflag removed fromda admin add-userandda auth import-token. JWTroleclaim removed from new tokens (existing tokens keep the claim, ignored on read). - BREAKING
/api/admin/permissionsendpoints removed (POST/DELETE/GET). Replaced by/api/admin/grants. Half-shipped/admin/permissionsadmin UI page removed (template, route). AGNES_ENABLE_TABLE_GRANTSenv-gate removed fromapp/resource_types.py—ResourceType.TABLEis now unconditionally enabled (the gate existed only because runtime enforcement still flowed through legacydataset_permissions).tests/test_permissions.py,tests/test_permissions_api.py,tests/test_access_requests_api.pydeleted (covered functionality removed).
Added
- Schema v19: drops
dataset_permissions,access_requeststables andusers.role,table_registry.is_publiccolumns. Implementation insrc/db.py:_v18_to_v19_finalizeuses the table-rebuild idiom (rename → create new → INSERT … SELECT → drop old) to work around DuckDB'sALTER TABLE DROP COLUMNlimitations on tables that have ever held FK constraints. The INSERT picks the intersection of the legacy and v19 column sets so test fixtures with hand-crafted minimal pre-v19 schemas migrate cleanly.
[0.26.0] — 2026-04-30
Changed
- BREAKING All host-side artifacts (compose files,
Caddyfile, host bash scripts) now ship in the docker image, not curled frommainat boot. The Dockerfile bakes them at/opt/agnes-host/and the customer-instance startup template extracts the whole directory viadocker create+docker cpfrom the sameimage_tagthe operator already pinned. Removes 5curls againstraw.githubusercontent.comfrom the customer template (docker-compose.yml,docker-compose.prod.yml,docker-compose.host-mount.yml,docker-compose.tls.yml,Caddyfile) plus theagnes-auto-upgrade.shcurl shipped in 0.25.0. The image also now shipsagnes-tls-rotate.sh+tls-fetch.shat/opt/agnes-host/so consumer-side deploy templates can adopt the same pattern. Replaces the curl-from-main pattern that decoupled host-side artifacts from the pinned image (split-brain — image atstable-2026.04.516, host artifacts floating on whatevermainwas when the VM last booted) and gave no rollback knob other than reverting upstream PRs globally. With everything baked in, host artifacts and app code are released together from one commit;image_tagcontrols all; rollback is one tag bump; egress simplifies to "private registry" only (no public-internet dependency on every boot). Drift prevention is preserved by construction — image and host artifacts CANNOT drift because they ship together. Operator action:image_tagMUST point to a tag from this release or later; older tags lack/opt/agnes-host/and the startupdocker cpwill fail-loud at first boot. Existing VMs are unaffected because the module setslifecycle { ignore_changes = [metadata_startup_script] }— only newly-created VMs run the new script. compose_refvariable on the customer-instance terraform module is deprecated — no longer used (compose files come fromimage_tagnow). Variable retained for one release cycle to avoid breaking existingterraform plans; will be removed in a future major bump. Pinimage_taginstead.
[0.25.0] — 2026-04-30
Fixed
scripts/ops/agnes-auto-upgrade.sh: fail-fast guard before anydocker composeaction — when the VM has a config disk attached (/dev/disk/by-id/google-config-diskexists),/data/stateMUST be backed by it. Three retry attempts with backoff, then exit non-zero. Prevents the silent regression where docker host-mount propagation unmounts the config disk and the app writes user state (DuckDB, marketplaces, session secret) onto/data(sdb) — wiped on the next container recreate. Re-appliesmount --make-rprivate /data /data/stateon every run to defend against propagation regressions.infra/modules/customer-instance/startup-script.sh.tpl: replaced the inline heredoc copy of the auto-upgrade script with acurlfromraw.githubusercontent.com/keboola/agnes-the-ai-analyst/main/scripts/ops/agnes-auto-upgrade.sh— single source of truth eliminates drift (the inline copy had fallen behind on TLS overlay detection, array-form compose files, and the new config-disk guard). VMs re-fetch on every boot, so script-only fixes propagate without an infra recreate. Also:docker-compose.tls.ymlis now fetched unconditionally (not only whentls_mode=caddy), because the canonical auto-upgrade script detects TLS at runtime via cert files on disk — certs can appear after boot viaagnes-tls-rotate.shor manual provisioning, and the cron job would otherwise fail every 5 min until the file was placed. Same reasoning extends toCaddyfile: fetched unconditionally now, plusagnes-auto-upgrade.shskips the tls overlay whenCaddyfileis missing/empty (defensive — without it the caddy service crash-loops while the overlay closes:8000, net effect "app unreachable").
[0.24.0] — 2026-04-30
Changed
-
Effective-access readout no longer short-circuits for admin users on
/admin/users/{id}and/profile. BothGET /api/admin/users/{id}/effective-accessandGET /api/me/effective-accesspreviously returnedis_admin=true, items=[]when the target was in the Admin group, and the UI rendered a flat "Full access via Admin" gold pill — which hid the underlying grant graph. Now both endpoints always run the JOIN, return the explicit per-resource breakdown, and surfaceis_adminonly as informational metadata on the response. The UI drops the special pill on both surfaces and renders the same per-resource table everyone else sees. Authorization at runtime still gives Admin god-mode regardless of this list (seeapp.auth.access.is_user_admin); this is purely an audit/debug surface for admins to see which Admin-group grants exist via which sibling groups. -
/profilegroup memberships use the same color-coded chip vocabulary as the rest of the admin surface. Each membership renders as a colored.group-chip(Admin yellow, Everyone gray, google_sync green, custom purple) with the same name-shortening rule (grp_acme_legal@workspace.example.com→Legal, full email on hover viatitle). The Status row in the Account card was removed — same admin signal already appears as the Admin chip in Group memberships, so the pill was redundant. Server-side: the/profileroute now projectsoriginanddisplay_nameper membership (computed via the shared_derive_originhelper + theAGNES_GOOGLE_GROUP_PREFIXstrip), so the Jinja template stays env-lookup-free. -
/admin/users/{id}polish: headerAdminpill removed, "Add to group" dropdown filters out google-managed groups, whole user-cell on the list page is one anchor. Header pill was redundant — the Group memberships section already shows the Admin chip with the canonical yellow color. The dropdown now skipsis_google_managedrows (bothcreated_by='system:google-sync'and the env-mapped Admin/Everyone) so admins don't see options the API would 409 on anyway. On/admin/usersthe avatar + name + email block became a single<a class="user-cell">linking to/admin/users/{id}so the entire info area lights up on hover, not just one line; the dedicatedDetailaction button stays for explicit affordance. -
/admin/users/{id}Group memberships table renders chips with the same color + name-shortening rules as the user list. The Group cell is now a<a class="group-chip">colored byis-admin(yellow) /is-everyone(gray) /is-google_sync(green) /is-custom(purple) and links through to/admin/groups/{group_id}. Google-sync chip text shortens viaderiveDisplayName(e.g.grp_acme_legal@workspace.example.com→Legal); raw email lives on the chip'stitleattribute. Powered by a neworiginfield onUserMembershipResponse(GET /api/admin/users/{id}/memberships), computed via the same_derive_originhelper the rest of the surface uses. -
/admin/usersmembership chips are color-coded by group origin and shorten Workspace-email names to a friendly form, so a row tells the same story as/admin/groupsat a glance. Colors: Admin → yellow, Everyone → gray, other google-synced groups → green, admin-created custom groups → purple. Name match (Admin/Everyone) takes precedence over origin so an env-mapped Admin/Everyone row (whose API origin isgoogle_sync) keeps its canonical color. The chip text for google_sync groups runs through the samederiveDisplayNamehelper used on/admin/groups:grp_acme_legal@workspace.example.comrenders asLegal(prefix stripped viaAGNES_GOOGLE_GROUP_PREFIX, capitalized), and the raw Workspace email goes into the chip'stitleattribute for hover reveal. Custom / Admin / Everyone chip text stays raw —deriveDisplayNamewould over-capitalize names likedata-team. To support this,GroupBriefonGET /api/usersnow carries the sameoriginfield as/api/admin/groups, computed via the shared_derive_originhelper. Replaces the v12-era 2-color layout (yellow Admin, gray for any other system row, blue for everything else, full email always shown) which gave no signal about whether a chip came from Workspace or a manual admin grant and overflowed the cell on long Workspace emails. -
/admin/accesssidebar + right-pane title now use the same group display rules as/admin/groups. Each sidebar row renders a multi-color origin pill (google_sync/system/custom) instead of the legacy yellow inlinesystemtag, and a monospace subtitle below the name showing the Workspace email when the row is wired to one (mapped_emailfor env-mapped Admin/Everyone, the rawnamefor user-created google-sync groups). The right-pane card head adopts the same treatment when a group is selected. To support this,GET /api/admin/access-overviewnow includesorigin,mapped_email,is_google_managed, andcreated_byper group — single source of truth shared with theGET /api/admin/groupsendpoint via the same helpers (_derive_origin,_mapped_email,_is_google_managed). -
GET /api/admin/groupsandGET /api/admin/access-overviewrename theoriginvalue"admin"→"custom". The label is named after the row's origin (admin-created via UI/CLI), not the creator's role, so the pill doesn't visually clash with the seededAdminsystem group's name. CSS class.origin-admin→.origin-custom; same purple swatch. No external consumers (CLI never reads the field). Pydantic default and JS fallbacks updated in lock-step. The previous workaround — a frontendoriginLabel()helper that mappedadmin → Customat render time — is gone now that the API value already reads correctly. -
/admin/groupsswitches the seeded Admin / Everyone rows to agoogle_syncchip and shows the Workspace email as a subtitle when env-mapped. Previously the mapped Admin row showedAdminas the big title withAdminrepeated as the subtitle (thederiveDisplayNamestrip-and-capitalize chain produced no useful output for a literal canonical name) and a yellowsystemchip — which buried the fact that membership is actually owned by Workspace. Now: whenAGNES_GROUP_ADMIN_EMAIL/AGNES_GROUP_EVERYONE_EMAILis configured,GET /api/admin/groupsreportsorigin='google_sync'for the matching seeded row (the system badge is suppressed; Workspace is the authoritative source of membership) and the newmapped_emailfield carries the configured Workspace email. The list view shows the canonical name as the big title with the Workspace email as a monospace subtitle (Admin / admins@workspace.test) and a greengoogle_syncchip. The/admin/groups/{id}detail header mirrors the same — name as<h1>,mapped_emailas thegd-title-emailsubtitle. Unmapped Admin / Everyone rows stayorigin='system'with no subtitle. Regular google_sync rows (whosenameis already the Workspace email) keep the existingderiveDisplayNamerewrite behavior withmapped_email=null. -
SSO-managed accounts are read-only for password / delete operations, both in UI and at the API layer. Detection is in
app.api.users._is_sso_user: a user counts as SSO-managed if they belong to any group whosecreated_by = 'system:google-sync', OR they belong to the seededAdminsystem group whileAGNES_GROUP_ADMIN_EMAILis set, OR the seededEveryonesystem group whileAGNES_GROUP_EVERYONE_EMAILis set. Users with no groups, or only admin-created custom groups, are unaffected. The flag surfaces asis_sso_user: boolon every/api/usersand/api/users/{id}response. UI: the/admin/usersrow actions and the/admin/users/{id}Account section suppress the Reset / Set pwd / Delete buttons for those rows. Server:POST /api/users/{id}/reset-password,POST /api/users/{id}/set-password, andDELETE /api/users/{id}now return 409 withdetail: "User is managed by an external SSO provider; …"for SSO targets — so a curl-savvy admin who bypasses the UI guard still cannot reset / set / wipe a Google Workspace account locally. Deactivate stays available so admins can gate access locally even when the upstream account is managed elsewhere. Name is provider-neutral so a future provider (Cloudflare Access, Okta, …) plugs into the same flag without churning the API.
Fixed
-
scripts/ops/agnes-tls-rotate.shnow chowns/data/state/certs/to UID 999 (theagnesuser inside the app image) on every run. Previously the script onlymkdir -p'd andchmod 700'd the directory, leaving ownership to whoever happened to create it first — root when systemd fired the timer before docker-compose-up, or UID 999 when the container's volume init touched it first. Race-dependent. When root won, the resultingdrwx------ root:rootdirectory was unreadable by the UID-999 container,_read_agnes_ca_pem()returnedNone, and the/installsetup prompt silently dropped the cross-platform TLS trust block (Step 0 from #137) — operators on those VMs ended up with no client-side cert bootstrap and a brokenclaude plugin marketplace addagainst the self-signed host. The chown is unconditional + idempotent (|| truefor hosts where the numeric GID can't be set), so re-running the timer self-heals existing VMs without manualchownon the operator's part. Files inside the directory keep their existing modes —fullchain.pemis0644(world-readable, so root- or 999-owned both work for the agnes container) andprivkey.pemis0600(only Caddy reads it, and Caddy's container runs as root). -
_is_sso_userno longer treatssystem_seed/adminmemberships in env-mapped Admin/Everyone as SSO (Devin BUG_0002 on PR #142). Without checkinguser_group_members.source, the v13 migration's blanket Everyone backfill (source='system_seed') flipped every existing local user tois_sso_user=Truethe moment an operator setAGNES_GROUP_EVERYONE_EMAIL— locking the admin out of password reset / set / delete on accounts the IdP doesn't actually own (the admin couldn't even un-flag them via "remove from Everyone" because_guard_google_managedblocks manual removal once env-mapped). The system-group branches (Admin / Everyone) now additionally requiresource='google_sync'. The created_by branch (system:google-syncgroups) is unchanged because those groups only exist because of Google sync — every membership in them is IdP-owned regardless ofsource. The v18 migration in this PR also retroactively cleans up the offendingsystem_seedrows in env-mapped Admin/Everyone groups; the source-check fix is the runtime guard that keeps future writes safe. -
POST /api/admin/users/{id}/membershipsnow returns the correctoriginfor the new membership (Devin review round 1 on PR #142). The handler constructedUserMembershipResponsewithout settingorigin, so the model default"custom"was returned regardless of the target group — while the matching GET endpoint computesoriginvia the shared_derive_originhelper. Adding a user to a system group (Admin / Everyone) over POST now reportsorigin="system"(or"google_sync"when env-mapped), matching GET. The UI re-fetches after add so visible impact was zero, but any non-UI API consumer got the wrong value. -
Schema migration v18: drop stranded non-google memberships in google-managed groups (Devin review round 1 on PR #142, partial response). v13's
_v12_to_v13_finalizeunconditionally backfilled every existing user into Everyone withsource='system_seed'under the original "Everyone = all users" semantics. The platform design has since shifted: whenAGNES_GROUP_EVERYONE_EMAIL/AGNES_GROUP_ADMIN_EMAILis configured, those system rows mirror a Workspace group exclusively, and only Google sync should write into them. The leftoversystem_seedrows (a) misrepresent the membership model and (b) cause_is_sso_userto flag local users as SSO-managed, blocking password-reset / set / delete via_reject_if_sso. v18 deletes: (1) non-google memberships in auto-createdcreated_by='system:google-sync'groups (unconditional — those groups only exist because Workspace materialized them), (2)system_seedrows in Everyone only whenAGNES_GROUP_EVERYONE_EMAILis set, (3)system_seedrows in Admin only whenAGNES_GROUP_ADMIN_EMAILis set ANDadded_by NOT IN ('app.main:seed_admin', 'auth.bootstrap')so the bootstrap admin always survives. Env-conditional branches mean a non-Google deployment keeps its local Admin / Everyone semantics intact (system_seed rows there are legitimate, not cruft). Runtime safeguards against future writes from the legacyusers.roleapparatus are tracked in #144.
Removed
GET /api/admin/group-suggestionsendpoint and the "Suggested from your Google account" picker on the/admin/groupscreate modal. The picker fetched the calling admin's Workspace groups (via Cloud Identity), filtered out ones already registered asuser_groupsrows, and offered them as one-click name pre-fills. Replaced by the OAuth callback's automaticgoogle_syncgroup materialization (every Workspace group the user belongs to that matchesAGNES_GOOGLE_GROUP_PREFIXis auto-created on login) — the manual picker became redundant. Cloud Identity calls in the request path are gone with it.
[0.23.0] — 2026-04-30
Added
- Single-item Edit button on every memory item card in
/corporate-memory/admin. Surfaces the per-itemPATCH /api/memory/admin/{id}endpoint added in #126 — until now it was only reachable via the CLI (da admin memory edit <id>) or by selecting one item in the bulk batch bar. The modal pre-fills from the item's current title / content / category / domain (dropdown matchingVALID_DOMAINS+(unset)) / audience / tags (comma-separated). Authorisation: samerequire_admingate as the rest of the memory admin surface. aisection editable in/admin/server-config. Theai:block ininstance.yaml(provider / api_key / model / base_url / structured_output for the corporate-memory extractor) was missing from_EDITABLE_SECTIONSandSECTION_META, so admins had no UI path to view or set the LLM token without editinginstance.yamldirectly.api_keyis auto-masked via the existing_SECRET_KEY_PATTERNS(substring matches "api_key"), so the input renders as a password field and audit-log diffs redact the value.MEMORY_DOMAINRBAC resource type for corporate-memory items. Admins use/admin/accessto grantuser_groupsaccess to specific domains (one offinance/engineering/product/data/operations/infrastructure). Members of granted groups see allknowledge_itemsin that domain regardless of the existingaudiencestring filter. The two filters compose with OR semantics, so the existingaudience='group:X'convention keeps working unchanged for ad-hoc per-item targeting; pre-grant deployments behave identically (when no MEMORY_DOMAIN grants exist, the OR clause collapses to a no-op). Wired inKnowledgeRepository.list_items/search/count_items/count_by_tag/count_by_audienceand in the inline SQL ofGET /api/memory/statsvia a newgranted_domainsparameter resolved fromresource_grantsby_caller_granted_memory_domains. Note: a MEMORY_DOMAIN grant is a parallel visibility path that pierces theaudiencefield — an item withaudience='group:admins-only'anddomain='finance'becomes visible to anyone with aMEMORY_DOMAIN/financegrant. Operators who relied onaudienceas a hard access boundary should be aware (Devin ANALYSIS_0003 on PR #141).
Fixed
- Edit modal NULL→empty-string preservation in
/corporate-memory/admin.submitEditItemwas sendingaudience=""for items whose stored audience was NULL, which silently broke visibility (the audience filter checksaudience IS NULL OR audience = 'all', neither of which matches empty string). Now empty form values foraudience/category/domain/contentare sent as JSONnullso the backend stores NULL. (Devin BUG_0001 on PR #141 5f649a4 review.)
[0.22.0] — 2026-04-30
Fixed
/api/v2/sample/{table_id},/api/v2/schema/{table_id},/api/v2/scan/estimate, and/api/v2/scannow return structured 502/400 instead of bare 500 when BigQuery raisesForbidden/BadRequest. Issue #134. Previously,_fetch_bq_sample,_fetch_bq_schema,_bq_dry_run_bytes, and_run_bq_scanhad notry/except, so a cross-project SA withoutserviceusage.services.useon the data project surfaced as an empty HTTP 500 — operators got no diagnostic. All four call sites now translategoogle.api_core.exceptions.Forbiddento HTTP 502 witherror: "cross_project_forbidden"(when the message mentionsserviceusage) plus adetails.hintpointing atdata_source.bigquery.billing_projectininstance.yaml, orerror: "bq_forbidden"for non-serviceusage ACL denials.BadRequesttranslates to HTTP 400 (bq_bad_request) on/scan/estimateand/scansince their SQL is user-derived (built fromreq.select/where/order_by), and to HTTP 502 (bq_upstream_error) on/sampleand/schemawhere SQL is server-constructed (server-builtSELECT * … LIMIT nandINFORMATION_SCHEMA.COLUMNSqueries respectively). The strict_fetch_bq_schemapath is wrapped; the best-effort_fetch_bq_table_optionspath retains its existingtry/except → return {}so/schemastill returns 200 with empty partition info if BQ metadata is unreachable./api/v2/sampleadditionally falls back todata_source.bigquery.billing_project(withdata_source.bigquery.projectas the default) —/scan/estimateand/scanalready had this fallback.
Changed
- BREAKING for deployments using
BIGQUERY_PROJECTenv var alongsidedata_source.bigquery.projectininstance.yaml. Issue #134. The env var now sets BOTH billing and data project (used as both the FROM-clause project AND the billing/quota target), overridingdata_source.bigquery.projectfor FROM-clause construction inv2_scan/v2_sample/v2_schema. PreviouslyBIGQUERY_PROJECTonly affectedRemoteQueryEnginebilling and was ignored by the v2 endpoints (which readinstance.yamldirectly). Migrate by clearingBIGQUERY_PROJECTand settingdata_source.bigquery.billing_project+data_source.bigquery.projectininstance.yamlinstead — the env var remains as a legacy override only.
Internal
- New shared module
connectors/bigquery/access.py—BqAccessfacade. Issue #134. Unifies BigQuery project resolution (BIGQUERY_PROJECTenv →instance.yaml billing_project→instance.yaml project),bigquery.Clientconstruction, DuckDB-extension session setup (INSTALL/LOAD/SECRETfromget_metadata_token()), and Google-API error translation (translate_bq_error()mappingForbidden/BadRequest/GoogleAPICallErrorto typedBqAccessErrorwithkind→ HTTP-status mapping). Replaces four near-identical inline blocks acrossv2_scan,v2_sample,v2_schema, andRemoteQueryEngine. FastAPI endpoints inject viaDepends(get_bq_access)(process-cached;instance_config.reset_cache()invalidates this cache too, so admin server-config saves hot-reload BQ project IDs without container restart);RemoteQueryEngineinjects viabq_access=BqAccess(...)constructor kwarg with lazy resolution (DuckDB-only paths never trigger BQ config lookup). When BigQuery isn't configured,get_bq_access()returns a sentinelBqAccesswhoseclient()/duckdb_session()raiseBqAccessError(not_configured)only when actually called — non-BQ instances (Keboola-only, CSV-only) get cleanDepends()resolution and 200s on local-source v2 requests. Two known-duplicate sites (connectors/bigquery/extractor.py,scripts/duckdb_manager.register_bq_table) explicitly out of scope; tracked as follow-up. - Internal API change in
RemoteQueryEngine:__init__no longer accepts_bq_client_factory(test-only injection point, prefix_). Tests migrate toRemoteQueryEngine(..., bq_access=BqAccess(projects, client_factory=...)). TheBqAccessErrorraised internally byBqAccessis translated to the existingRemoteQueryError(error_type="bq_error")shape in_get_bq_client, preserving the public contract — CLI (cli/commands/query.py) and/api/query/hybridcallers see no change. Removed the stale docstring atsrc/remote_query.pyreferencingscripts.duckdb_manager._create_bq_clientas the default factory (it never was). - Side-effect behavior change for unusual cross-project setups in
/api/v2/sample. Issue #134. The FROM-clause project for/sampleis nowdata_source.bigquery.project(the data project) rather than the conflatedbilling_projectvalue — the Phase 1 fix passedbilling_project(when set) as both the billing target AND the FROM-clause project. Deployments wherebilling_project ≠ projectAND the queried table physically lives inbilling_project(an unusual setup contradicting the documented config semantics) must move the table to the data project or unsetbilling_project. No effect on the standard cross-project setup (table in data project, jobs billed to billing project). scripts/smoke-test.sh: assertion 8 now hits/api/admin/registry(the current admin tables endpoint). The old/api/admin/tablesURL was renamed long ago and the smoke test was returning 404 on every run — it only surfaced as a deploy failure when the full release pipeline first triggered the rollback path on the post-#137 deploy (run 25151878647). Same stale URL was also fixed inCLAUDE.md,README.md, anddev_docs/server.md— the routes now correctly point atPOST /api/admin/register-table(create) andPUT /api/admin/registry/{id}(update)..github/workflows/release.ymlsmoke-test job: addedLog in to GHCRstep. The auto-rollback'sdocker push :stablewas hittingunauthenticated: User cannot be authenticated with the token providedbecause the smoke-test job had no GHCR login of its own. Result: a failed deploy left:stablepointing at the broken image. The rollback step also got an explicitGH_TOKENenv, and the workflow's top-levelpermissionsblock gainedissues: write, so itsgh issue createcall actually creates the alert issue (was silently swallowed by the|| echofallback because of both the missing env var AND the missing scope).
[0.21.0] — 2026-04-30
Internal
scripts/dev/agnes-client-reset.sh— destructive cleanup of an Agnes client install on a developer workstation, mirror image ofapp/web/setup_instructions.pyso an onboarding-from-scratch test is reproducible. Removes thedaCLI (uv tool uninstall),~/.config/da/~/.agnes/~/.claude/skills/agnes, the Claude Codeagnesmarketplace + its plugins, the Agnes CA from the OS trust store (Windowscertutil -delstore, macOSsecurity delete-certificate -Z, Linuxupdate-ca-certificates/update-ca-trust), theAGNES_CA_PEM_TRUSTblock from the user's shell rc (with.agnes-reset.bakbackup), and/tmp/agnes*.whlmatches. Cross-platform (Git Bash on Windows / macOS / Linux);--yesskips the confirm prompt,--dry-runprints actions without executing.
Changed
-
Trust block heredoc trimmed to 8 lines so reset script's
skip = 8matches exactly (Devin review round 3 on PR #137). The_tls_trust_blockheredoc was emitting 9 lines into the user's shell rc (a leading empty line + theAGNES_CA_PEM_TRUSTmarker + 7 export/comment lines), butscripts/dev/agnes-client-reset.shawk strips exactly 8 lines starting at the marker — leaving the leading empty line behind. On repeated install/reset cycles, those stray empty lines accumulated in~/.zshrc/~/.bashrc. Removed the leading empty string from the heredoc body in_tls_trust_blockso the heredoc now writes exactly 8 lines, matching the awk count. Added two regression tests that pin the invariant — one asserts the heredoc body length, the other parsesskip = Nout of the reset script via regex and cross-checks it against the heredoc body line count, so future drift on either side fails loudly. -
Marketplace block re-detects
$PLATFORMso Linux actually gets the direct-HTTPS attempt (Devin review round 2 on PR #137).$PLATFORMis set in step 0(a) but the prompt itself warns that env vars don't persist across separate Bash invocations (step 0(e) IMPORTANT note). The marketplace step'scase "$PLATFORM" inran in a later Bash call where$PLATFORM="", falling through to the*)catch-all which hard-codesMARKETPLACE_VIA=clone— defeating the Linux-only direct-HTTPS attempt that node-basedclaudewould have honored viaNODE_EXTRA_CA_CERTS. Marketplace block now re-detects$PLATFORMvia the sameuname -sswitch from step 0(a) before its case statement, making the block self-contained. Same fix not applied to step 0(c)'s$PLATFORMuse because step 0 is meant to run as a single Bash block (a→b→c→d→e in sequence) where the variable is still in scope. -
Setup prompt no longer references steps that may not have been emitted (Devin review on PR #137). Three places hard-coded references to optional steps regardless of whether those steps were actually rendered. (1) Confirm step's summary bullets unconditionally listed "Which CA bundle source got picked in step 0(d)" and "Whether the marketplace add went via direct HTTPS or via the git-clone fallback" — both phantom in the default no-CA, no-plugins flow, and an LLM following the prompt would either ask the user about non-existent steps or hallucinate.
_FINALE_LINES_TEMPLATEconstant replaced with_finale_lines(has_ca, has_marketplace)that conditionally appends each bullet. (2) Preamble's "The fallback chain inside step 0(d) is documented and OK to use" pointed at a non-existent step whenca_pemwas unset._preamble_lines(has_ca)now drops that line in the no-trust-block path; the "don't disable TLS verification" guidance stays unconditional (valid generic advice). (3) Trust block step 0(c) said "without this, step 7's marketplace add fails" — stale after the layout reordering moved marketplace to step 5 (and made it optional). Reworded to describe the consequence without naming a step number. -
Marketplace step now uses the git-clone fallback on macOS too — not only Windows — and strips the PAT from the cloned repo's
.git/configafter clone. First fix:claudeon macOS arm64 ships as a Mach-O binary with a__BUNsegment (single-filebun build --compile); reverse engineering itsstringstable shows it recognizesNODE_EXTRA_CA_CERTS/SSL_CERT_FILE/REQUESTS_CA_BUNDLE/CURL_CA_BUNDLE(including a "NODE_EXTRA_CA_CERTS detected" log line) but in practice none of them — nor the macOS login keychain — is honored for the marketplace HTTPS request, leaving the direct-add path failing withunable to verify the first certificateeven after step 0(c) registered the cert. So the marketplacecasenow matcheslinux)for the direct-then-fallback path and*)(= Windows + macOS, both Bun-compiled) for straight-to-clone. Second fix:git clone https://x:<PAT>@host/...writes the URL verbatim into~/.agnes/marketplace/.git/config, so the PAT then sits in plaintext at a path that gets read by cloud-sync agents (iCloud, OneDrive) and antivirus scanners on default home setups; after clone we now rungit remote set-url origin "https://<host>/marketplace.git/"to drop the token, plus a best-effortchmod 700/chmod 600(wrapped in|| trueso it's a no-op on Windows NTFS via MSYS / Git Bash). Marketplace registration uses the local FS path, not the remote URL, so removing the token doesn't break anything — refreshes go via re-running setup with a fresh PAT from the dashboard. Third fix: each shell-out (git clone,claude plugin marketplace add,claude plugin install <name>@agnes) is now wrapped in|| { echo "ERROR..." >&2; exit 1; }so a failure halts the prompt loudly instead of falling through to a confusing downstream error (e.g. failed clone →marketplace 'agnes' not foundfrom the nextplugin install). Fourth fix: the diagnose step now calls out thatdb_schema: unknownis also normal for non-admin roles (e.g.analyst) on populated instances, not just on fresh installs — analyst lacks grants on the system schema, so the field staysunknownforever and was previously misread as a yellow check. -
Setup prompt step ordering reshuffled so all installation work runs before the human-loop skills question. Old order interleaved the human question (skills, step 5) between install (step 1) and marketplace/plugins (step 7), which led the assistant to either block on the user mid-install or "do the rest in parallel" while waiting. New order: install → login → verify → git check → marketplace + plugins → diagnose → skills (last interactive step before Confirm) → Confirm. With marketplace plugins to install, that's steps 1-2-3-4-5-6-7-8; without plugins, 4-5 (git/marketplace) collapse out and diagnose/skills/confirm renumber to 4-5-6. The skills step now explicitly tells the assistant to wait for the user's answer before moving to Confirm — the old "you can continue in parallel" hint is gone because there's no longer anything to do in parallel.
da diagnoserunning late doubles as a final smoke test after plugins are in place. -
Setup prompt's TLS trust block rewritten to be cross-platform and to dodge three TLS pitfalls observed across real workstation setups. The previous block exported
SSL_CERT_FILE/NODE_EXTRA_CA_CERTS/GIT_SSL_CAINFOall pointing at the single Agnes CA; this caused (1) every Python tool in the same shell to lose its system trust store (PyPI immediately broke withUnknownIssuerbecauseSSL_CERT_FILEis a replace, not an append), (2)uv tool install <https-url>against the Agnes wheel endpoint to fail with rustls'CaUsedAsEndEntitybecause the Agnes leaf cert is its own CA —--native-tlsdoesn't help (the rejection happens during chain validation, not trust lookup), and (3)claude plugin marketplace addto fail on Windows becauseclaude.exeignores both the OS trust store andNODE_EXTRA_CA_CERTSfor marketplace HTTPS. The new step 0 (a) detects platform viauname+$SHELLand picks the correct shell rc file (zsh→.zshrc, bash on macOS→.bash_profile, else→.bashrc), (b) writes the cert PEM via single-quoted heredoc, (c) registers the cert in the OS trust store (Windowscertutil -user -addstore Root, macOSsecurity add-trusted-cert, Linuxupdate-ca-certificates/update-ca-trust) — no admin rights needed, idempotent on re-run — so native binaries that bypass our env vars still trust the host, (d) builds a combined CA bundle at~/.agnes/ca-bundle.pem(system roots + Agnes CA) using a fallback chain for the system roots source (systempython3 -c 'import certifi'→ distro/curl bundle paths →uv run --with certifias last resort), (e) persistsSSL_CERT_FILE/REQUESTS_CA_BUNDLE/GIT_SSL_CAINFOpointing at the combined bundle while keepingNODE_EXTRA_CA_CERTSon justca.pem(Node's append semantics). When the trust block is emitted, step 1 also switches to a curl-then-local-install pattern (curl --cacertto download the wheel,uv tool install --native-tls --force <local-file>to install) so rustls never sees the Agnes host. Step 7 (marketplace) goes platform-aware: Windows skips the direct HTTPS attempt and uses a systemgit clonefallback (system git honorsGIT_SSL_CAINFO), macOS/Linux try direct first. Step 4 (diagnose) calls out thatdb_schema: unknownanddata: 0 tablesare normal on fresh installs. Step 5 (skills) makes clear the assistant can continue with steps 6-7 while waiting for the user's skills answer. Step 12 (marketplace) calls out the harmlessgit: 'credential-manager-core' is not a git commandwarning so the operator doesn't chase it. The legacygit config sslVerify=falsedowngrade path stays as a fallback for instances without afullchain.pemon disk (so existingAGNES_DEBUG_AUTHsetups keep working).
Added
- "Set up a new Claude Code" prompt now bootstraps the marketplace and plugins. The clipboard payload generated by the dashboard CTA appends a git pre-flight check (
git --version, withbrew install git/winget install --id Git.Gitinstall commands for macOS / Windows) followed by a marketplace-registration step that runsclaude plugin marketplace add "https://x:<PAT>@<host>/marketplace.git/"and oneclaude plugin install <plugin>@agnes --scope projectper RBAC-allowed plugin (resolved viamarketplace_filter.resolve_allowed_plugins). When the user has no plugin grants, the original 6-step layout is preserved. WhenAGNES_DEBUG_AUTHis enabled on the server (dev/self-signed-cert instances), a host-scopedgit config --global http."<server>/".sslVerify falseline is also included so the marketplace clone works against the self-signed endpoint. Plugins load on the nextclaudestart. - Setup prompt inlines the server's TLS cert as a step-0 trust block on instances with a private CA / self-signed chain.
app.web.router._read_agnes_ca_pemreads/data/state/certs/fullchain.pem(path overridable viaAGNES_TLS_FULLCHAIN_PATH; the file is bind-mounted into the app container bydocker-compose.host-mount.ymlfrom the same locationagnes-tls-rotate.shwrites). Self-signed leaves and CA-signed leaves whose issuer isn't in the server-sidecertifitrust store are inlined into the prompt; publicly-trusted chains (Let's Encrypt etc.) are skipped so users don't unnecessarily narrow their default Python TLS trust. The inlined block writes the PEM to~/.agnes/ca.pemvia single-quoted heredoc (so$/backtick chars in the cert never shell-expand) and exportsSSL_CERT_FILE,NODE_EXTRA_CA_CERTS,GIT_SSL_CAINFOfor the current shell + persists them to~/.bashrc/~/.zshrc(idempotent via a marker grep guard) sodakeeps trusting the host across new terminal sessions. When the trust block is emitted, the legacygit config sslVerify=falsedowngrade is suppressed — full TLS validation re-enabled, just against the inlined cert. Cross-platform (macOS bash/zsh + Windows Git Bash) — same env vars, same heredoc syntax. Replaces thegit config sslVerify=false-only path that brokeclaude plugin marketplace add(Node has its own HTTPS client and ignoresgit config) anduv tool install(rustls, no insecure flag) on self-signed instances.
[0.20.0] — 2026-04-29
Added
- Dev debug toolbar gated by
DEBUG=1. Mountsfastapi-debug-toolbarwith panels for headers, routes, settings, versions, timer, logging, and a custom DuckDB panel that captures everycon.execute()fromsrc/db.py(tagged bysystem/analytics/analytics_ro). Seedocs/development.md. X-Request-IDrequest header / response header on every FastAPI response, plus arequest_idfield in JSON logs for cross-process correlation.- Request-ID surfaced end-to-end on error responses:
Reference: <rid>block on the renderederror.htmlpage (withuser-select: allfor one-click copy) and a"request_id": "<rid>"field in the JSON 5xx body. The same id appears in thex-request-idresponse header, so a support ticket can be traced from a single value the user sees on the page. - Dev log lines now carry the request id via
_RequestIdFilter—RichHandlerformat is[<rid>] [<logger>] <msg>(or[-]outside of a request scope). JSON formatter already includedrequest_id; this closes the gap forDEBUG=1development. - Centralized
app.logging_config.setup_logging()— replaces 23 scatteredlogging.basicConfig(...)calls. Usesrich.logging.RichHandlerin dev (DEBUG=1) and JSON to stderr in prod.
Changed
- All service entrypoints (
services/scheduler/__main__.py,ws_gateway,telegram_bot,corporate_memory,session_collector,verification_detector) and CLI scripts underscripts/andconnectors/jira/scripts/now callsetup_logging(__name__)instead of inlinebasicConfig. Library modules no longer configure root logger at import time. - BREAKING Telegram bot no longer writes to
/data/notifications/bot.log. All bot logs go to stdout, captured by Docker. Usedocker compose logs -f notify-botto read them. Operators tail-ing the file must update their runbooks; seedev_docs/telegram_bot.mdfor the new procedure (includingjournalctlfallback for non-Docker hosts). - Toolbar middleware is mounted INSIDE the GZip middleware (innermost on response) so the toolbar can decode HTML before compression. RequestIdMiddleware remains outermost; production behavior (DEBUG unset) is byte-identical to before.
Fixed
- Removed rogue module-level
logging.basicConfigfromapp/api/sync.pythat was reconfiguring root logger every time the api module was imported. RequestIdMiddlewarerewritten as a pure ASGI middleware (wasBaseHTTPMiddleware). Removes the earlyrequest_id_var.resetinfinallythat fired BEFORE BackgroundTasks ran, causing them to lose the id. Also side-steps the knownBaseHTTPMiddlewareContextVar-cross-task issue.- Incoming
X-Request-IDheaders are now sanitized (alnum +-/_, truncated to 64 chars; falls back to a fresh uuid if nothing legal remains). Closes a CRLF log-forging vector when log handlers don't escape newlines. _wants_htmlno longer treatsAccept: */*(curl default) or empty Accept as "wants HTML". Operators who curl non-API paths get JSON{"detail": "..."}as before — only real browsers (withAccept: text/html,...) get HTML error pages. (Devin ANALYSIS_0003 on PR #136 review.)- Subprocess extractor in
app/api/sync.pyre-installslogging.basicConfigso INFO-level extraction progress fromconnectors.keboola.extractor.run()reaches stderr again (was silently dropped by Python'slastResorthandler after the import-timebasicConfigcleanup). (Devin BUG_0002.) .env.templatecomment forDEBUG=1no longer claims to enableFastAPI debug=True— that flag is intentionally NOT toggled (Starlette'sServerErrorMiddlewarewould intercept unhandled exceptions before the custom error handler runs). (Devin BUG_0001.)- Security: HTML error page (500) no longer leaks
str(exc)in production. The JSON branch already guarded that string behinddebug_onbut the HTML branch did not — browser users could see raw exception messages containing DB paths, SQL fragments, internal hostnames, or credentials embedded in connection strings. The HTML branch now mirrors the JSON branch'sdebug_oncheck; production users see only"Internal server error"plus the request id. (Devin BUG on b1c6ee9 review.)
Internal
pyproject.toml: addedfastapi-debug-toolbar>=0.6.3to dev optional deps.services/telegram_bot/config.py: removed unusedBOT_LOG_FILEconstant.tests/conftest.py: removed stale comment about bot.py FileHandler.
[0.19.0] — 2026-04-29
Added
table_registry.sync_scheduleis now honored at runtime.POST /api/sync/trigger(called by the scheduler sidecar every 15 min by default) drops local tables whose schedule says they are not due. Tables without a schedule continue to sync on every tick (opt-in feature). ManualPOST /api/sync/trigger {"tables":[...]}bypasses the schedule filter — operator override always wins. (#79)script_registry.scheduleis now honored at runtime via the new endpointPOST /api/scripts/run-due(admin-only). The scheduler sidecar fires this every 60 s by default. Each due script is claimed atomically (last_status='running'), executed in a BackgroundTask, and the outcome written tolast_run/last_status. Scripts already inrunningstate are skipped — no concurrent runs of the same script. (#78)- Four new env vars on the scheduler sidecar:
SCHEDULER_DATA_REFRESH_INTERVAL,SCHEDULER_HEALTH_CHECK_INTERVAL,SCHEDULER_SCRIPT_RUN_INTERVAL,SCHEDULER_TICK_SECONDS. All accept positive integers (seconds); tick must be ≤ smallest job interval. Documented indocs/DEPLOYMENT.md→ Scheduler tuning. (#77) RegisterTableRequest.sync_schedule,UpdateTableRequest.sync_schedule, andDeployScriptRequest.schedulenow reject malformed strings with a Pydantic 422 (e.g."hourly","daily 25:00"). The accepted forms are unchanged:every Nm,every Nh,daily HH:MM[,HH:MM,...]. Note: cron expressions ("0 8 * * MON"etc.) were never honoured by the runtime evaluator — they used to round-trip through the API as a silent no-op, and now they get a loud 422 at register/deploy time. Operators using cron strings must convert to one of the supported forms. (#78, #79)- New
verify_sslknob in theopenmetadata:section ofinstance.yaml(defaulttrue). Operators on internal CAs / self-signed catalogs must set it explicitly. (#89)
Changed
- BREAKING
POST /api/scripts/deploynow validates the source against the safety blocklist BEFORE persisting (previously safety checks ran only at execution time). Scripts containing blocked imports / patterns return 400 from/deployinstead of being stored and failing every scheduler tick. Closes the claim-fail-retry loop where the new/api/scripts/run-dueendpoint would re-claim and re-fail an unrunnable deployed script every minute. (#78) - BREAKING
OpenMetadataClientnow defaults toverify=Truefor TLS. The previous version hardcodedverify=Falseand suppressed urllib3's "Unverified HTTPS request" warning at import time (which leaked to every other httpx client in the process). Existing deployments on self-signed certificates without an explicit opt-out will start failing TLS verification — setverify_ssl: falsein theopenmetadata:block ofinstance.yaml, or supply a CA bundle path, before upgrading. Both production call sites (connectors/openmetadata/enricher.py,src/catalog_export.py) read the newverify_sslconfig knob and pass it through. (#89) - BREAKING
GET /marketplace/info(admin-only debug endpoint)namefield now returns the plugin's authoritative name from itsplugin.json(e.g.plug-x) instead of the slug-prefixed form (<slug>-<plug-x>). The slug-prefixed form moved to a newprefixed_namefield next to it;original_nameis unchanged. Side-effect of the/pluginUI fix below — the synth marketplace.json'snamefield had to switch over for Claude Code's catalog lookup to work, and/marketplace/infomirrors that surface for consistency. Any downstream tooling that parsed thenamefield expecting the slug-prefixed format must now readprefixed_name. (#133)
Fixed
/pluginUI in Claude Code rendered "Plugin not found in marketplace" in the Components panel for every plugin Agnes served, even though agents/skills/commands loaded correctly under the plugin's own namespace. Root cause: the synthetic.claude-plugin/marketplace.jsonlisted each plugin under a slug-prefixedname(<slug>-<plugin>) while the plugin's authoritative.claude-plugin/plugin.jsonkept the original name. Claude Code resolves the loaded plugin back to its catalog entry byplugin.jsonname, so the lookup missed every entry. The synth manifest now reads the plugin's authoritative name from<plugin_dir>/.claude-plugin/plugin.json(falling back to the upstream marketplace.json'snamewhen the plugin manifest is absent or unreadable). The directory layout underplugins/<slug>-<plugin>/...keeps the prefix so two upstream marketplaces that ship a same-named plugin still get distinct on-disk paths in the ZIP / git tree — their catalog entries will then collide under the samename, which is the correct surface (admin RBAC decides which upstream wins, same as if a user added both upstream marketplaces directly to Claude Code)./marketplace/infonow exposesprefixed_namealongsidenameso operators can still disambiguate cross-marketplace shadowing. (#133)
Internal
src/scheduler.pynow exportsis_valid_schedule(s)andfilter_due_tables(configs, sync_state_repo)for reuse across the sync filter, the script runner, and Pydantic validators.ScriptRepositorygainsclaim_for_run(script_id)andrecord_run_result(script_id, status)— the atomic primitives for the scheduled-script execution path.claim_for_runusesUPDATE … WHERE last_status IS DISTINCT FROM 'running' RETURNING idfor race-free claim.services/scheduler/__main__.pyJOBS list refactored to abuild_jobs()factory that reads + validates env at startup.
Known limitations
- Stuck
last_status='running': a scheduled script whose BackgroundTask crashes mid-run (process killed, OOM, gateway timeout) stays claimed forever. Recovery:UPDATE script_registry SET last_status = NULL WHERE id = ?from a DuckDB shell. Auto-recovery via max-runtime detection is intentionally out of scope for v0.19.0; revisit if it bites in practice. - Schedule quantization rounds up:
SCHEDULER_*_INTERVALaccepts seconds but the underlying schedule grammar is minute-grained. Non-multiples of 60 round UP to the next minute (90 s →every 2m, neverevery 1m) so a job never fires more often than the operator configured. Sub-minute values clamp toevery 1m. Documented indocs/DEPLOYMENT.md→ Scheduler tuning.
[0.18.0] — 2026-04-29
Added
- Corporate-memory tree view + cross-axis filtering on
/corporate-memoryand/corporate-memory/admin. Operators choose a grouping axis (domain / category / tag / audience) and combine it with chip filters (status, source_type, audience, has-duplicate-hint, search). Tree uses native<details>; localStorage persists open/closed state per axis; no new dependencies. Issue #62. - Corporate-memory duplicate-candidate hints — admin sees a "Duplicate Candidates" tab with likely-duplicate item pairs detected by entity overlap (Jaccard score, ≥2 shared entities, same domain). Resolution actions:
duplicate/different/dismissed. Auto-merge intentionally not included. Issue #62. - Bulk-edit endpoints:
PATCH /api/memory/admin/{id}(now accepts category/domain/tags/audience/title/content, was title+content only);POST /api/memory/admin/bulk-updatefor multi-id mutations with per-item audit rows; new "Move to category / domain / audience" + "Add/Remove tag" actions in the admin batch bar. Issue #62. GET /api/memory/statsnow includesby_tag(DuckDBjson_eachover tags) andby_audienceaggregations to power chip-filter pickers. Issue #62.GET /api/memory/tree?axis=...&...— server-side grouping endpoint that returns{groups: [{key, label, count, items: [...]}]}, RBAC-filtered, with chip filters (status_filter,source_type,audience,q,has_duplicate). Issue #62.da admin memory {tree,edit,bulk-edit,stats,duplicates list,duplicates resolve}— full CLI parity for the new admin endpoints. Issue #62.- Schema v17: new
knowledge_item_relationstable for duplicate-candidate hints. PK(item_a_id, item_b_id, relation_type)with canonical(min, max)pair ordering at the repository layer; auto-migration v16→v17 idempotent. Issue #62. - BigQuery table registration via admin UI + CLI (issue #108 — Milestone 1). Operators on a BigQuery instance can now register a BQ table or view as a remote DuckDB master view from
/admin/tablesorda admin register-table, without hand-editingtable_registryor running the extractor by hand. The register modal branches ondata_source.typeserver-side: BQ instances see Dataset / Source Table / View Name / Description / Folder / Sync Schedule; Keboola instances keep the discovery-driven flow. Submit runs/api/admin/register-table/precheckfirst (round-tripsbigquery.Client.get_tableto confirm the table exists and the SA can see it; surfaces row count + size + column count in the modal), then commits. The server validates BQ-specific shape (dataset / source_table / DuckDB-safe identifiers / GCP project_id grammar), forcesquery_mode=remote+profile_after_sync=false, and synchronously rebuildsextract.duckdb+ master views with a 5s wall-clock budget — on overrun, the rebuild continues in aBackgroundTaskand the API returns 202 with{"status": "accepted", "view_name": ...}instead of 200. View-name collisions (distinct from id collisions) return 409 to stop two callers from registering the same DuckDB view via different display names.sync_scheduleis accepted and stored but not yet evaluated by the scheduler — see issue #79; addressed in Milestone 3 of #108. Seedocs/DATA_SOURCES.md. POST /api/admin/register-table/precheck— validation-only sibling of register-table. Returns{"ok": true, "table": {rows, size_bytes, columns, …}}for BQ rows after round-trippingget_table; surfaces NotFound → 404, Forbidden → 403, anything else → 400 with the GCP error verbatim. Also runs Pydantic validation for non-BQ source types so the CLI / UI gets a single endpoint shape.--dry-runflag onda admin register-table— calls/precheckand pretty-prints rows / bytes / columns; exits 0 onok, 1 on validation or source-side error.- Audit-log entries on every
register_table/update_table/unregister_tablemutation — closes the asymmetry where instance-config saves audited but registry mutations didn't (Decision 4 in #108). Secret-named fields in the request payload are masked as***;descriptionis logged raw. - Google Workspace group prefix filter + system-group mapping. Three new env vars wire the OAuth callback's group sync to a configurable Workspace prefix and route the admin/everyone Workspace groups into the seeded system rows.
AGNES_GOOGLE_GROUP_PREFIX— when set (e.g.grp_acme_), only Workspace groups whose email local part starts with the prefix are mirrored intouser_group_members. Empty = legacy behavior (mirror every fetched group).AGNES_GROUP_ADMIN_EMAIL— Workspace group email that maps onto the seededAdminsystem row instead of creating a freshuser_groupsentry. Members of that Workspace group land inAdmindirectly.AGNES_GROUP_EVERYONE_EMAIL— same mechanism forEveryone.
- Login gate. When
AGNES_GOOGLE_GROUP_PREFIXis set and the user's Workspace fetch returned a non-empty list with zero prefix matches, the callback redirects to/login?error=not_in_allowed_groupwith a friendly inline banner. Empty fetch results (transient Cloud Identity failures) preserve the cached membership and let the login proceed — fail-soft only the soft-fail path; an explicit no-match still blocks. New error codegroup_check_unavailableis wired through the login banner for future use. - Admin UI subtitle for synced groups. The
/admin/groupstable and the/admin/groups/{id}detail page render a derived display name (prefix stripped,@domainremoved, capitalized) above a small monospace subtitle showing the full Workspace email. Edit / Delete affordances are hidden on Google-managed rows, and a "managed by Google Workspace — read-only here" banner appears on the detail page.
Changed
- BREAKING Auto-
Everyonemembership for new users was removed.UserRepository.createno longer writes auser_group_membersrow, andapp.auth.access._user_group_idsno longer adds a virtualEveryoneid to the result. Every membership now traces to a real source row (admin,google_sync, or an explicitsystem_seed). If you relied on the implicit-Everyone behavior for plugin visibility, grant the plugin to a real group (e.g. aneveryone@example.comWorkspace group mapped viaAGNES_GROUP_EVERYONE_EMAIL). - Admin UI / API are read-only on Google-managed groups.
created_by='system:google-sync'rows, plus the seededAdmin/Everyonerows when the matching email-mapping env var is set, return409with body{"detail": {"code": "google_managed_readonly", ...}}fromPATCH /api/admin/groups/{id},DELETE /api/admin/groups/{id},POST /api/admin/groups/{id}/members,DELETE /api/admin/groups/{id}/members/{user_id},POST /api/admin/users/{id}/memberships,DELETE /api/admin/users/{id}/memberships/{group_id}. Edit through admin.google.com, then sign in again to refresh. - Audit action names for corporate-memory operations renamed from
km_<action>tocorporate_memory.<action>to match the 0.15.0 CHANGELOG documentation. The audit-tab filter accepts both prefixes for back-compat with rows already in the audit log (no historical-row rewrite). Issue #62. onDomainChange()UX bug fixed on/corporate-memory: domain and category filters now compose instead of resetting each other when either changes. Issue #62.POST /api/memory/admin/editcontinues to accept title/content as before; the newPATCH /api/memory/admin/{id}is the recommended path for everything else (including title/content). The legacy endpoint is kept one release for back-compat.
Internal
- New env vars surfaced into
ConfigProxyso templates can derive the friendly display name client-side. - New
is_google_managed: boolfield onGroupResponse(the API surface for the admin UI's group list/detail). - New
UserGroupMembersRepository.has_any_google_sync_membershiphelper (currently diagnostic; kept for a future tightening of the gate). - New tests in
tests/test_google_group_prefix_sync.py;tests/test_repositories.py::TestUserRepositoryEveryoneAutoMemberrenamed toTestUserRepositoryNoAutoMembershipwith inverted assertion; twotests/test_marketplace_filter.pytests adapted to the no-implicit-Everyone semantics. Seedocs/auth-groups.mdfor the full reference.
Fixed
PATCH /api/memory/admin/{id}now switches frommodel_dump(exclude_none=True)toexclude_unset=True, so an explicitnullin the request body clears the field (e.g.{"audience": null}resets a previously-set audience to NULL). Pre-fix nulls were silently dropped, leaving no path to clearaudienceand only the empty-string short-circuit fordomain. The endpoint now distinguishes "field absent from body" (untouched) from "field explicitly set to null" (cleared). BothPATCH /api/memory/admin/{id}andPOST /api/memory/admin/bulk-updatenow reject an explicitnullfortitle(NOT NULL in the schema) at the boundary with HTTP 400 instead of bubbling up as a 500 (PATCH) or per-item Constraint Error (bulk). Issue #62 / PR #126 review.- Empty-string
domainis now consistently allowed acrossPOST /api/memory,PATCH /api/memory/admin/{id}, andPOST /api/memory/admin/bulk-update— previously create allowed it (short-circuit on falsy) but PATCH/bulk-update rejected it with 400, which made it impossible to clear a domain through the admin endpoints. Issue #62 / PR #126 review. - Bulk-edit modal
(unset)option for the domain field is now actually submittable. Pre-fix the JS rejected empty values with "Please enter a value" before the request fired, so the operator-visible "(unset)" option couldn't ever clear a domain even though the backend supports it. Issue #62 / PR #126 review. POST /api/memory/admin/bulk-updatenow enforces an API-layer allowlist of mutable fields (category,domain,tags,tags_add,tags_remove,audience,title,content). Pre-fix the endpoint forwarded any key in the repo's_UPDATABLE_FIELDSset, which includedstatus,sensitivity,is_personal, andconfidence— an admin couldPOST {"updates": {"status": "mandatory"}}and silently bypass/admin/mandate's dedicated audit trail (the bulk audit row also stampedupdated_fields: []for those mutations, leaving no trace of what changed). Disallowed keys now return HTTP 400 with the offending list; the repo layer is unchanged so the per-itemrepo.updatepath keeps its broader access. Issue #62 / PR #126 review.- Tree endpoint
audience=allchip now includes NULL-audience items, matching the SQL audience filter (audience IS NULL OR audience = 'all'),count_by_audience(COALESCE→'all'), and_bucket_key(NULL → "all"). Pre-fix the in-memory chip filter compareditem.audience != 'all'and dropped NULL-audience items from the bucket they were supposed to land in. Issue #62 / PR #126 review. GET /api/memory/admin/audithonorspage— the SQL hadLIMITonly and silently returned the first page for every page parameter. Both branches (action-filtered and unfiltered) now applyOFFSET (page - 1) * per_page. Issue #62 / PR #126 review.POST /api/memoryvalidatesdomainagainst the same allowlistPATCH /admin/{id}andPOST /admin/bulk-updateuse, so an item can't be created with a domain it can't later be patched to. Empty / missing domain is still accepted. Issue #62 / PR #126 review.da admin memory edit --add-tag/--remove-tagcould silently drop existing tags when the target item lived past page 1 of/api/memory. The CLI did GET-then-PATCH for tag mutations, looked the item up in the first 50 rows of the unfiltered list, and overwrote the tag set with[just_added]when it didn't find the row. Tag mutations now route throughPOST /api/memory/admin/bulk-update(single-id array, server-side merge with the existing tags). Issue #62.da admin memory duplicates listcouldn't list both resolution states — the CLI always sentresolved=true|falseand the API defaulted toresolved=falsewhen omitted, so neither path returned the full set.GET /api/memory/admin/duplicate-candidatesnow treats omittedresolvedas "no filter"; the CLI omits the flag by default and only sets it when the user passes--resolvedor--unresolved. The web UI continues to passresolved=falseexplicitly so the actionable backlog stays the default surface. Issue #62.PUT /api/admin/registry/{id}now preserves the originalregistered_attimestamp instead of resetting it tonow()on every edit.TableRegistryRepository.registeracceptsregistered_atas an optional kwarg;update_tablere-passes the existing value from the row it just read. Closes #130.
[0.17.0] — 2026-04-29
Added
- Shared-secret auth path for the in-cluster scheduler service (
SCHEDULER_API_TOKEN). Both theappandschedulercontainers source the same/opt/agnes/.envvia Docker Composeenv_file:, so a 256-bit secret generated once at VM provisioning serves both sides symmetrically. The app validates incomingAuthorization: Bearer <secret>against the env var (constant-time compare; minimum length 32 chars; rejected when env is empty) and resolves matches to a syntheticscheduler@system.localuser that is a member of theAdminsystem group — every existing RBAC gate (require_admin,require_resource_access) works unchanged. Audit-log entries from the scheduler are attributed to this user. Rotation: edit.env,docker compose restart app scheduler. Seeapp/auth/scheduler_token.pyfor the threat model. POST /api/marketplaces/sync-all— admin-only endpoint that runssrc.marketplace.sync_marketplaces()inside the app process. Wired up so the scheduler container can drive the nightly refresh over HTTP without openingsystem.duckdbdirectly.
Fixed
- Scheduler
marketplacesjob 500-ed every cron tick withIO Error: Could not set lock on file system.duckdbafter v0.12.1. The previous implementation calledsrc.marketplace.sync_marketplaces()in-process from the scheduler container, but DuckDB permits only one writer per file across processes — the scheduler raced the app's long-lived handle. Switched the job toPOST /api/marketplaces/sync-all, making the app the sole writer; the scheduler is now a pure cron clock. - Scheduler
data-refreshjob 401-ed every 15 minutes withMissing or invalid Authorization headerbecauseSCHEDULER_API_TOKENwas never propagated byinfra/modules/customer-instance/startup-script.sh.tpl. The startup script now generates a 64-hex-char secret on first boot viaopenssl rand -hex 32, persists it across reboots by reading back from an existing.env(rotation requires explicit operator action — both containers must restart together), and writes it into/opt/agnes/.envalongside the other secrets.app/main.pyseeds the matching synthetic user at startup so the very first cron tick has a valid actor to attribute audit-log entries to. Existing VMs need a one-timesudo /opt/agnes/agnes-rotate-scheduler-token.sh(or simply re-run the startup script viaterraform apply -replace='module.agnes.google_compute_instance.vm["<vm-name>"]'); see migration note in this changelog or rerun the startup script manually. - Non-root container couldn't write to host-bind-mounted
/dataafter the v0.12.1 USER-agnes flip.infra/modules/customer-instance/startup-script.sh.tplnowchown -R 999:999 /dataafter creating the persistent-disk subdirs (state,analytics,extracts). Without this, a freshly-attached PD is root-owned by default andUSER agnes(uid 999) cannot open/data/state/system.duckdbfor write — every authed request 500s withIOException: Cannot open file ... Permission deniedwhile/api/health(which doesn't open the system DB) keeps returning 200, masking the failure from health-only monitoring. Regression first observed onagnes-developmenton 2026-04-29 after the auto-upgrade picked up:stablefrom the 0.12.1 release. Existing VMs with PD-backed/dataneed a one-time host-sidesudo chown -R 999:999 /var/lib/docker/volumes/agnes_data/_data && sudo docker restart agnes-app-1 agnes-scheduler-1to recover — Terraformmetadata_startup_scriptonly runs on boot, so an apply alone does not retro-fix running VMs. Dockerfilepins theagnesuser touid:gid 999:999explicitly (useradd --uid 999). Previously the uid was whatever Debian'suseradd --systemassigned next — happened to be 999 today, but a future base-image change picking 998 or 1000 would silently desync from the startup-script'schown 999:999, reintroducing the same incident. Pinning makes the contract grep-able from both sides.scripts/smoke-test.shno longer silently SKIPs every authed check whenbootstrapreturns 403 (users exist) andSMOKE_TOKENis not set — it now FAILs loudly. Also adds an unauthenticated DB-touching probe (POST /auth/email/request) before bootstrap, since/api/healthdeliberately doesn't opensystem.duckdb(kept cheap for LB probes) and so cannot detect filesystem/permission issues. The new probe catches a class of regression that bypasses health-only monitoring even on instances where bootstrap is closed.- Corporate memory pages (
/corporate-memory,/corporate-memory/admin) now render the shared app header at full viewport width, matching the dashboard. Previously the_app_header.htmlinclude sat inside.container-memory(max-width: 1000px) and was cropped on wide viewports. release.ymlnow publishes a:dev-<slug>+:dev-<prefix>-latestimage when a fresh branch is pushed offmainwith no extra commits. Pre-fix,paths-ignoreon thepushevent diffed the new ref against the default branch — a same-SHA branch had zero diff, every file matched paths-ignore, and the workflow was skipped, so a developer creating a personal branch off main to deploy main's exact state to their dev VM (which pins to:dev-<user>-latest) had to either commit something or trigger the workflow manually. Thebuild-and-pushjob'sifwas also tightened tomain || workflow_dispatchonly, which prevented branch-push images regardless. Both fixed: addedcreate:trigger (filtered to branch refs at the job level so tag creates don't double-build withkeboola-deploy.yml), and broadenedbuild-and-push.ifto also publish on non-main branch pushes / branch creates.- Web header admin nav (All tokens, Marketplaces, Admin → Users / Groups / Resource access / Server config) is now visible to admin users again. Pre-fix,
_app_header.htmlgated the admin block onsession.user.role == 'admin', but the v13 RBAC migration nulledusers.roleand moved admin authority ontouser_group_members(Admin system group) — so the gate evaluated to false for everyone, including actual admins.get_current_usernow injectsuser["is_admin"](computed viaapp.auth.access.is_user_admin, the same call all server-side admin gates use), and the header readssession.user.is_admin. The role badge in the user-menu dropdown now reads "Admin" or hides —users.roleis no longer surfaced in the UI. admin_tablesregister modal payload now matches theRegisterTableRequestAPI contract — drops the phantomidandversionfields the modal used to send (the API silently dropped them), and renamesdataset→bucketso the source-bucket actually persists. Pre-fix the operator's bucket / dataset edit looked saved but never made it past the wire. Edit + delete handlers in the same template were dropping the same fields and are also corrected.- Discovery JS in
admin_tablesnow handles the actual{tables: [...]}flat shape returned byGET /api/admin/discover-tables. Pre-fix the JS expected{buckets: [...]}(a shape the API never emitted) and silently rendered an empty discovery panel after the first call. - #108 review fixes for BigQuery register-table. (a) The post-register materialize worker (BackgroundTask + 5s-timeout daemon thread) no longer captures the request-scoped DuckDB connection — it opens a fresh
get_system_db()handle per run, so the request'sfinally: conn.close()no longer races the worker. (b)connectors/bigquery/extractor.init_extractis now serialized by a module-level_INIT_EXTRACT_LOCKso the timeout-fallback BackgroundTask cannot collide with the still-running daemon thread on theextract.duckdbswap. (c)PUT /api/admin/registry/{id}now runs the same BQ-shape validation as register when the merged record is a BigQuery row (or the patch flips it to BigQuery), returning 400/422 instead of silently persisting an unsafebucket/source_table/ project_id and breaking at the next rebuild. (d)POST /api/admin/register-tableno longer carries a misleadingstatus_code=201on the route decorator — the Keboola branch explicitly returns 201, the BigQuery branch returns 200 (sync) or 202 (timeout fallback), and OpenAPI now documents all three. - #108 round-4 review fix for BigQuery register-table.
_validate_bigquery_register_payloadnow applies the same raw-value rule tobucketandsource_tableas round-3 added forname. Pre-fix the helper validatedbucket.strip()/source_table.strip()butregister_tablepersisted the un-stripped value, so abucket=" my_dataset"slipped through validation, got stored verbatim, and 500'd at the next rebuild when the BQ extractor spliced it intoATTACH … AS bq_<bucket>and view DDL. The validator now rejects anybucket/source_tablewith leading/trailing whitespace and surfaces the offending raw value in the 400 detail. Applies identically toPOST /api/admin/register-tableandPOST /api/admin/register-table/precheck. - #108 round-3 review fixes for BigQuery register-table. (a)
_validate_bigquery_register_payloadnow validates the raw view name (the value persisted totable_registry.nameand read back by the BQ extractor), not a normalizedstrip().lower().replace(" ", "_")form. Pre-fix a name like"my table"passed validation (normalized"my_table"was safe), got stored verbatim, and then 500'd at the post-insert rebuild — defeating fast-fail-at-register. The validator now rejects any name with leading/trailing whitespace OR that fails the strict^[a-zA-Z_][a-zA-Z0-9_]{0,63}$check, and surfaces the offending raw value verbatim in the 400 response so the operator can retype with a corrected name. Server does NOT silently rewrite the input. Applies identically toPOST /api/admin/register-tableandPOST /api/admin/register-table/precheck. (b)_run_bigquery_materialize_with_timeoutnow distinguishes worker-raised-within-budget (→{"status": "errors"}→ HTTP 500 with the exception in the body) from worker-still-running-at-timeout (→{"status": "timeout"}→ HTTP 202 + BackgroundTask retry). Pre-fix both outcomes mapped to "timeout" / 202, hiding the real failure for the budget window before the BG retry surfaced the same exception in the logs. (c)register_table_precheckis now a plaindef(wasasync def) — the BQ branch makes synchronousbigquery.Client(...)/client.get_table(...)calls that would otherwise block the asyncio event loop on an async handler. Mirrors the same conversion already done forregister_table. - #108 round-2 review fixes for BigQuery register-table. (a)
POST /api/admin/register-tableis now a plaindef(wasasync def) — the synchronous-materialize path waits onthreading.Event.wait(), which blocks the asyncio event loop on an async handler and stalls every other request for up to the 5s budget. FastAPI runs sync handlers in a threadpool so the wait is harmless there. (b)connectors/bigquery/extractor.rebuild_from_registrynow resolvesdata_source.bigquery.projectviaapp.instance_config.get_value(deep-merge of static + writable overlay) instead ofconfig.loader.load_instance_config(static only). Operators who set the project throughPOST /api/admin/configuregot a silent rebuild failure pre-fix — validation passed (validation already used the overlay-aware read) but the rebuild reported "project missing" and the master view never appeared. (c)register-tablenow propagatesrebuild_from_registryerrors as HTTP 500 with{"status": "rebuild_failed", "errors": [...]}when the synchronous rebuild ran but reported an error (auth failure, missing project, unsafe identifier slipping the validator). Pre-fix those errors were silently logged and the API returned 200 ok. The BackgroundTask path now logs rebuild errors at ERROR level (was WARNING). (d) The admin tables UI's BigQuery register modal now splits precheck and register into two operator-driven clicks — Step 1 fires precheck and surfaces row count / size / column count in the modal AND swaps the primary button to "Register"; Step 2 fires the actual register call only when the operator clicks. Pre-fix the precheck and register fired in a single chained promise, so the operator never got to review the summary before the row was committed. (e) The Keboola register-modal payload now derivessource_tablefrom the discovered table's storage identifier (t.idminus the bucket prefix, e.g.companyforin.c-sfdc.company) via a new hiddenregSourceTablefield. Pre-fix the JS sentregTableName(the human-friendly display name) assource_table; manual-entry callers fall back to the display name. (f)da admin discover-and-registeraccepts HTTP 200 / 201 / 202 as success (was 201 only); pre-fix every successful BigQuery row counted as an error because BQ register returns 200 (sync OK) or 202 (background) but never 201.
Internal
_sanitize_for_auditnow masks against an explicit_SECRET_FIELDSallowlist instead of substring-scanning + maintaining aprimary_keywhitelist exception. New tests assertnot_actually_a_token/primary_key_hash/passwordlessflow through cleartext while known-secret fields (keboola_token,client_secret,smtp_password,bot_token) get masked. Operationally identical for the current registry payloads (no secret-bearing fields), but removes a class of false-positive / false-negative as the request body grows.release.ymladds ane2e-bind-mountjob that boots the freshly built image against a host-bind-mounted/datadirectory (instead of the named volume the existingsmoke-testjob uses). Docker initializes a fresh named volume by copying from the image's/data— which the Dockerfile chowns toagnes:agnesbefore flipping USER — so the named-volume path always works. The bind-mount path mirrors what GCE VMs run viadocker-compose.host-mount.yml, and includes a negative assertion (write must fail on root-owned/databefore the operator chown) plus a positive assertion (smoke passes after the chown). Locks in the contract that broke a recent release: removingchown 999:999fromstartup-script.sh.tplor changing the Dockerfile uid pin breaks CI.- Extracted
bigquery.extractor.rebuild_from_registry()from the__main__block ofconnectors/bigquery/extractor.pyso the API can call it post-register withoutrunpy-importing the module. The standalone CLI entrypoint (python -m connectors.bigquery.extractor) keeps working.
0.16.0 — 2026-04-29
Minor release. Comprehensive deploy safety audit — CI/CD pipeline hardening, 50+ new tests covering previously untested failure modes, DB schema health check, config versioning, and BigQuery ATTACH error resilience. Built on top of v0.15.0 / 2e1dfb7.
PR: #120 (ci/deploy-safety-audit).
Added
- ruff lint + mypy type check in
release.ymlandkeboola-deploy.ymlCI workflows (bothcontinue-on-error: trueinitially — 257 pre-existing ruff errors, mypy has pre-existing issues; neither blocks CI yet). - Automatic rollback on smoke test failure in
release.yml— tags the broken image as:deprecated-<short-sha>, reverts:stableto the previous good tag, opens a GitHub issue for investigation. - Smoke test in
keboola-deploy.yml— was completely missing; now runs the samesmoke-test.shasrelease.yml. - Expanded smoke-test.sh — added
/api/catalog,/api/admin/tables,/marketplace.zip,/api/metricsendpoint checks beyond the original/api/health. - Post-deploy smoke test (
scripts/ops/post-deploy-smoke-test.sh) — validates health, DB schema version, query endpoint, catalog, and marketplace on a prod VM after deploy. - DB schema version check in
/api/health— returnsdb_schema: "ok" | "mismatch" | "unreachable"; overall status becomes"unhealthy"on schema mismatch. Lets load balancers and monitoring detect half-migrated instances. - Config versioning —
config_version: 1ininstance.yaml, validated at startup by_validate_config_version()inconfig/loader.py. Prevents silent misconfiguration when the config schema evolves. .github/settings.yml— required status checks onmainbranch..github/dependabot.yml— weekly pip + github-actions dependency updates..github/CODEOWNERS— default@keboola/agnes-team, special owners for/infra/,/app/auth/,src/db.py..pre-commit-config.yaml— detect-private-key, check-yaml/json/merge-conflict, ruff, mypy.[tool.ruff]config inpyproject.toml—line-length = 120,target-version = "py313".
Test Coverage (~50 new tests)
- v13→v14 migration (
test_db.py): orphan cleanup, FK constraints, rollback on failure. - Email magic link TTL (
test_auth_providers.py): expired token, token reuse, wrong token. - PAT (
test_pat.py): malformed JWT, empty bearer,last_used_iptracking. - Marketplace ZIP (
test_marketplace_server_zip.py): ETag/304, PAT auth, content-addressed caching,invalidate_etag_cache()on mutation. - Marketplace Git (
test_marketplace_server_git.py): smart HTTP, Basic auth with PAT, RBAC filtering. - Jira webhooks (
test_jira_webhooks.py): HMAC validation, missing signature, malformed JSON (10 tests). - Hybrid Query BQ (
test_remote_query.py):register_bq, JOIN local+BQ, error handling (12 tests). - Keboola extractor (
test_keboola_extractor.py): crash, partial write, timeout, extension fallback (9 tests). - BigQuery extractor (
test_bigquery_extractor.py): corrupted DB, partial write, atomic swap, ATTACH timeout (6 tests). - Orchestrator (
test_orchestrator.py): corrupted extract.duckdb, empty_meta, mid-write, unsafe identifiers (5 tests).
Fixed
- BigQuery extractor ATTACH error handling —
init_extract()now catches exceptions onINSTALL/ATTACHand records them instats["errors"]instead of propagating up. A network timeout or auth failure no longer crashes the extractor; all configured tables are marked as skipped. - ETag cache invalidation on disk mutation —
invalidate_etag_cache()is the documented way to force re-hash after marketplace sync. Tests now call it after mutating on-disk content.
Internal
fetch-depth: 0+fetch-tags: trueinrelease.ymlfor rollback tag resolution.- Docs updated:
ARCHITECTURE.md,docs/DATA_SOURCES.md,docs/QUICKSTART.md,docs/RBAC.md,docs/auth-groups.md.
0.15.0 — 2026-04-29
Minor release. Adds corporate memory v1+v1.5 and /me/debug self-only auth diagnostic. See GitHub release for full notes.
0.14.0 — 2026-04-28
Minor release. Replaces BigQuery wrap-view pattern with Claude-driven fetch primitives. See GitHub release for full notes.
0.13.0 — 2026-04-28
Minor release. Admin server-config editor + Windows PowerShell wrapper. See GitHub release for full notes.
0.12.1 — 2026-04-28
Patch release. Hotfixes the pre-migration snapshot-integrity bug shipped in v0.12.0 and bundles the security/ops hardening from issue groups #82 (auth hardening), #85 (API validation), #87 (deploy posture), plus #46 (SSRF) and #90 (memory stats blocking).
Added
- Path-traversal validation on
/api/data/{table_id}/download—table_idis now checked against_SAFE_QUOTED_IDENTIFIERregex (allows dots and hyphens for Keboola-style IDs likein.c-crm.orders) before any filesystem or DB operation; unsafe values return 404 (no info leakage). See issue #85/C2. - SSRF protection on
POST /api/admin/configure—keboola_urlis validated against private/reserved networks (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, localhost, IPv6 loopback/link-local/unique-local). Uses DNS resolution +ipaddressmodule for robust IPv6 handling (catches abbreviated forms likefe80::1,fc00::1). See issue #46. - Caddyfile security headers:
X-Frame-Options DENY,X-Content-Type-Options nosniff,Referrer-Policy strict-origin-when-cross-origin,-Server(strip). See issue #87/M22. - Container runs as non-root user
agnes—USERdirective added to Dockerfile withuseradd+chown. See issue #87/C13. - Docker resource limits:
mem_limit: 4g,mem_reservation: 1g,cpus: 2.0onapp;mem_limit: 2g,cpus: 1.0onscheduler. See issue #87/M21. - Startup warning when no user has
password_hash— alerts operators that/auth/bootstrapis reachable. See issue #82/C8. - Audit logging for failed web form login attempts (
/auth/password/login/web) — mirrors the existing/auth/tokenaudit trail. See issue #82/M9. /api/health/detailedendpoint (authenticated) — returns full diagnostics (version, schema, sync state, user count). Minimal/api/health(unauth) returns only{"status": "ok"}for load balancers. See issue #87/M17.- Health endpoint monitoring guide in
docs/DEPLOYMENT.md— documents both endpoints and how to wire external monitoring tools (Datadog, Prometheus, UptimeRobot) to/api/health/detailedwith a PAT.
Changed
- BREAKING
docker-compose.override.ymlrenamed todocker-compose.dev.yml. Docker Compose auto-mergesdocker-compose.override.ymlon every host with the repo, silently enabling dev mode (source mount +--reload) on production. The new name requires explicit-f docker-compose.dev.yml, eliminating the foot-gun. Update any scripts or workflows that relied on auto-merge.scripts/run-local-dev.shandMakefileupdated accordingly. See issue #87/M23. - BREAKING
/api/healthnow returns a minimal{"status": "ok"}payload (unauthenticated, for load balancers). Full diagnostics moved to/api/health/detailed(requires authentication). Scripts that parsed/api/healthfor version, sync state, or user count must switch to/api/health/detailedwith anAuthorizationheader. CLI commands (da setup test-connection,da setup verify,da diagnose,da status) updated to call/api/health/detailedfor service-level checks, with graceful fallback to the minimal endpoint when auth is not configured. See issue #87/M17. release.ymlCI workflow:build-and-pushjob now only runs onmainpushes or manualworkflow_dispatchtriggers. Non-main branch pushes run tests only. Addedpaths-ignorefordocs/**,*.md,LICENSE. See issue #87/M26.
Fixed
- Pre-migration snapshot integrity — the snapshot file written
before a v(N-k)→vN migration now captures the true on-disk state
before any DDL runs, instead of the post-self-heal state the
0.12.0 hoist (#106) introduced. With the unconditional
conn.execute(_SYSTEM_SCHEMA)at the top of_ensure_schema, the full set of modern-binary tables (view_ownership,marketplace_registry,user_groups,resource_grants, etc.) was materialized first, thenCHECKPOINTflushed them to disk, andshutil.copy2copied the already-modified DB as the "pre-migration" snapshot — so an operator inspecting the snapshot for rollback debugging saw the binary's full table set instead of the old schema. Functionally rollback still worked (extra empty tables are harmless and re-running migration is idempotent), but the snapshot was misleading. Fix: gate the self-heal call oncurrent >= SCHEMA_VERSION. The split-brain (current > SCHEMA_VERSION) and same-version safety-net (current == SCHEMA_VERSION) paths still self-heal as before; the migration path (current < SCHEMA_VERSION) takes its snapshot first and then runs_SYSTEM_SCHEMAfrom inside the existing migration block. reset_tokenno longer leaks in the JSON response body ofPOST /api/users/{id}/reset-password. Thereset_urlstill contains the token (as intended), but the raw secret is no longer exposed to DevTools, proxy logs, or CLI stdout. CLIadmin reset-passwordnow prints the URL instead of the bare token. See issue #82/C5./api/memory/statsno longer blocks the async event loop — replacedrepo.list_items(limit=10000)+ Python loop with a single SQLGROUP BYaggregation. See issue #90.- Magic-link token consumption is now atomic — compare-and-swap pattern
with a unique
CONSUMED:marker prevents two concurrent verifies from both succeeding. DuckDB concurrent-write conflicts are caught and converted to 401. See issue #82/M10. - Password reset confirm (
POST /auth/password/reset/confirm) now uses the same compare-and-swap pattern as the magic-link flow — closes the remaining asymmetry onusers.reset_tokenconsumption. Lower severity than the magic-link race because the reset flow ends with a new password (an attacker would need the reset token and to race the legitimate user) but the consistency closes a polish gap. New regressiontest_concurrent_reset_only_one_winsintests/test_password_flows.py::TestResetConfirm. - Upload endpoints (
/sessions,/artifacts) now stream to a temp file with cumulative size check instead of buffering the entire body in memory before the size cap — prevents OOM from oversized uploads. Temp file handle is properly closed beforeshutil.moveto avoid FD leaks. See issue #85/M4. /api/upload/local-mduses a SHA-256 hashed filename instead of rawuser_email— stable per user, no charset surprises from email addresses. See issue #85/M4./auth/bootstrap403 message no longer leaks user count. See issue #82/n1.
Internal
- New regression
test_split_brain_future_version_with_missing_tables_self_healsintests/test_db.py::TestMigrationSafety— synthesizes a v99 DB whose only table isschema_version, runs_ensure_schema, asserts that the v13-era core tables (users,user_groups,user_group_members,resource_grants) get materialized and thatschema_versionstays at 99 (self-heal without falsely advertising a downgrade). - New regression
test_pre_migration_snapshot_excludes_post_self_heal_tablespins the snapshot-integrity contract: a v2→vN migration's snapshot must not contain any post-v2 table from the modern binary. Sanity-checked against the pre-fix unconditional hoist — fails with 6 leaked tables. test_future_version_is_noopdocstring updated to reflect that the self-heal pass does run on a future-version DB, just doesn't touch the version row. The test still passes unchanged — its only assertion was the version-row contract, which holds.test_no_override_fileregression test assertsdocker-compose.override.ymldoes not exist post-rename. See issue #87/M23.
0.12.0 — 2026-04-28
Changed
/admin/accessresource tree now visually separates the three-level hierarchy (resource type → block/bucket → item). Each resource-type section gets a colored left stripe and a faint tinted banner; sections are separated by an 8px neutral gap. Stripe colors cycle 4-wide vianth-childso adding new resource types toapp/resource_types.pyworks without touching CSS. The first-position color is the project primary blue (#0073D1), avoiding the violet (#6366f1) reserved for granted items.
Added
ResourceType.TABLE— admins can grant table-level access peruser_groupvia the/admin/accesspage. Tables registered intable_registryare listed grouped bybucket, with the existing per-block "Grant all" / "Revoke all" bulk actions. Listing and grant storage only — runtime enforcement still flows through legacydataset_permissions; the migration plan lives indocs/TODO-rbac-data-enforcement.md.AGNES_ENABLE_TABLE_GRANTSenv var (default off) gates the half-builtResourceType.TABLEchip. While disabled the chip is hidden from/admin/accessandPOST /api/admin/grantsreturns 422 with the env-var name indetailon a TABLE grant attempt. Existing TABLE rows inresource_grantsstay listable and deletable — the flag controls UI exposure and new-grant acceptance only, never blocks cleanup.da admin break-glass <user>CLI — recovery path when the operator has locked themselves out of/admin/access. Adds the user to the Admin user_group withsource='system_seed'regardless of RBAC state. Bypasses authentication; relies on filesystem access to${DATA_DIR}/state/system.duckdbimplying host-level trust. Document this in deployment runbooks alongsideSEED_ADMIN_EMAIL.
Internal
scripts/seed_dummy_tables.py— populatestable_registrywith 12 dummy tables across 3 buckets (in.c-finance,in.c-marketing,in.c-product), each withis_public=False, for exercising the new/admin/accessTables section without a configured data source./marketplace.zipshort-circuits to304before any file IO or ZIP compression on a matchingIf-None-Match. Hot path on every Claude Code SessionStart hook. Backed by an in-processcachetools.TTLCacheover the resolved-plugins → ETag map (default 120s, env-tunable viaAGNES_MARKETPLACE_ETAG_TTL, set0to disable).invalidate_etag_cache()is called by marketplace sync after refresh so the next request re-hashes against new on-disk content instead of waiting for TTL expiry. New explicit dependency:cachetools>=5.3.0.
Fixed
/admin/accessgroup sidebar grant-count badges no longer revert to a stale value when switching between groups. The badge was readingstate.groups[i].grant_count, a snapshot populated once at/access-overviewload; toggling a grant only updated the DOM (viarefreshCounts), not that field, so the nextrenderGroupscall (triggered byselectGroup) would clobber the live count with the original snapshot.renderGroupsnow derives the count live fromstate.grants, the array thattoggleGrant/bulkSetkeep in sync. Server data was always correct — only the in-page badge drifted until refresh./catalog,/admin/tables, and/admin/permissionspages now render the shared top header correctly. The pages include_app_header.html(which uses.app-*CSS classes) but were not linkingstyle-custom.csswhere those classes are defined; onlydashboard.htmlandbase.htmldid. Without the stylesheet the nav links, dropdowns, and user menu rendered as unstyled inline text. Added the missing<link>to all three templates.PATCH /api/admin/groups/{id}on a system group now correctly accepts description-only updates while still rejecting renames. The endpoint guard previously short-circuited with409 "System groups are immutable"for any mutation, which contradicted the repository layer's narrowed contract (rename-only rejection) — a description-only payload like{"description": "..."}would hit the endpoint short-circuit and never reach the repo. The endpoint now 409s only whenpayload.namediffers from the existing name; a no-op rename (same name in payload) is dropped from the update before reaching the repo.- Google OAuth callback no longer wipes a user's
google_syncgroup memberships on a transient Workspace API failure.fetch_user_groupsis fail-soft and returns[]for both "no groups" and "API error" — the callback used to feed that empty list intoreplace_google_sync_groups, which deletes allsource='google_sync'rows for the user and then inserts zero. A login during a transient Cloud Identity hiccup would silently drop every Workspace-synced membership the user had built up. Admin-added memberships (source='admin') were already protected. The callback now skipsreplace_google_sync_groupswhen the fetch returns empty and logs "preserving existing memberships" instead. Trade-off: a user whose Workspace groups were genuinely cleared keeps stale memberships until the next non-empty sync — accepted untilfetch_user_groupslearns to distinguish empty-success from empty-failure. docker-compose.host-mount.ymlnow useso: bind,rbindinstead ofo: bindfor thedatavolume. With a plain bind, sub-mounts under/dataon the host (e.g. the dual-disk layout where sdc is mounted on/data/state) are silently shadowed inside the container by an empty subdirectory on the parent disk. The container then writessystem.duckdband other state to the wrong disk; the dedicated state disk receives no writes and accumulates only the snapshot left by the migration script. Recursive bind propagates existing sub-mounts at container start, so the container sees the same filesystem the host does. Operators on dual-disk VMs need to copy the live DB from/var/lib/docker/volumes/agnes_data/_data/state/(sdb's empty subdir) onto/data/state/(sdc) before redeploying with the fix, or the next start will surface the stale snapshot.
Changed
- BREAKING Marketplace endpoint (
/marketplace.zip,/marketplace.git/*) no longer god-modes for Admin members.src.marketplace_filter.resolve_allowed_pluginsnow filters every caller — admins included — throughresource_grants. Admins curate their own marketplace view by granting plugins to the Admin group (or any group they belong to). Existing installs where the only membership on Admin is the admin themselves will see an empty marketplace until grants are added in/admin/access. App-level authorization (require_admin,can_accessfor non-marketplace types) is unaffected — Admin is still god mode there. - BREAKING RBAC redesigned around two layers: app-level access via the
Adminuser-group (god mode short-circuit) and resource-level access via a generic(group, resource_type, resource_id)grant model. The four-valuecore.viewer/analyst/km_admin/adminhierarchy withimpliesBFS expansion is gone — every protected endpoint now uses eitherrequire_adminorrequire_resource_access(ResourceType.X, "{path}")from the newapp.auth.accessmodule. Authorization is decided per-request via a single DB lookup; no session cache, no dual-path resolver, no_hydrate_legacy_roleshim. Seedocs/RBAC.md. - BREAKING
internal_roles,group_mappings,user_role_grants, andplugin_accesstables removed. Replaced byuser_group_members(binds users to user_groups with asourceenum:admin/google_sync/system_seed) andresource_grants(group →(resource_type, resource_id)). Schema v13; the migration backfills from v12 atomically —users.groupsJSON is converted intouser_group_membersrows withsource='google_sync',core.admingrants become Admin-group memberships withsource='system_seed', andplugin_accessrows becomeresource_grantsof typemarketplace_plugin. Theusers.groupsJSON column is dropped; the deprecatedusers.rolecolumn is kept NULL as a legacy artifact. - BREAKING Schema v14 —
user_group_membersandresource_grantsnow declare DuckDB foreign-key constraints ongroup_id(referencinguser_groups.id). Cascade deletes can no longer leave orphaned member / grant rows pointing at a deleted group. Migration is RENAME → CREATE-with-FK → INSERT → DROP, wrapped inBEGIN TRANSACTIONso a partial failure rolls back without leaving the DB at a half-applied schema. Forks that touched these tables outside the documented repository APIs need to verify the FK direction matches their writes. - BREAKING Admin REST surface unified under
/api/admin/groups,/api/admin/groups/{id}/members,/api/admin/grants,/api/admin/resource-types.app.api.role_managementandapp.api.plugin_accessremoved. The web UI route/admin/role-mappingand/admin/plugin-accessare replaced by a single/admin/accesspage; the_app_header.htmllink is renamed to "Access". - BREAKING CLI subcommands
da admin role *,da admin mapping *,da admin grant-role,da admin revoke-role,da admin effective-rolesremoved. New subcommands:da admin group {list,create,delete,members,add-member,remove-member}andda admin grant {list,create,delete,resource-types}.da admin set-role <user> adminstill works as a thin wrapper that toggles Admin-group membership. - Module authors no longer call
register_internal_role(...). Resource types are anapp.resource_types.ResourceTypeStrEnumpaired with aResourceTypeSpecregistered inRESOURCE_TYPES; adding a new resource type means adding one enum member, onelist_blocks(conn)projection delegate, and one spec entry — all inapp/resource_types.py. The registry drives both/api/admin/resource-typesand/api/admin/access-overview, so there's no second wiring step. No DB migration, no startup hook. - Google OAuth callback writes Cloud Identity group memberships into
user_group_members(source='google_sync') instead ofusers.groupsJSON. Manual admin-added memberships (source='admin') survive subsequent logins.
Removed
app/auth/role_resolver.py,app/api/role_management.py,app/api/plugin_access.py.src/repositories/internal_roles.py,src/repositories/group_mappings.py,src/repositories/user_role_grants.py.app/web/templates/admin_role_mapping.html,app/web/templates/admin_plugin_access.html.Roleenum +has_role,is_admin,is_km_admin,is_analyst,_is_admin_user_dict,set_user_role,get_user_rolefromsrc/rbac.py. Dataset-access helpers (can_access_table,get_accessible_tables,has_dataset_access) preserved.- Test files:
test_role_resolver.py,test_api_role_management.py,test_admin_role_mapping_ui.py,test_cli_admin_role.py,test_schema_v9_migration.py,test_plugin_access_api.py.
Internal
src/db.pyschema bumped to v13. New helpers_seed_system_groups(idempotent Admin/Everyone seed, runs on every connect) and_v12_to_v13_finalize(one-shot backfill + DROP cascade) replace_seed_core_rolesand_backfill_users_role_to_grants.app.auth.accessis the new authorization vocabulary:_user_group_ids,is_user_admin,can_access,require_admin,require_resource_access. Lives in its own module to avoid the circular import that would happen if it sat inapp.auth.dependencies(the dependency factory needsget_current_userfrom there).- New
tests/helpers/auth.py::grant_admin(conn, user_id)— adds a user to the Admin system group sorequire_adminresolves to True. Updated test fixtures acrosstest_admin_tokens_ui,test_password_flows,test_pat,test_api,test_api_complete,test_api_scripts,test_web_uito call it afterUserRepository.create(role="admin"). The legacyusers.rolecolumn alone is no longer the admin marker. - Skipped at module level (rewrite required for v13):
test_admin_user_capabilities_ui(asserts the gone v9 capabilities UI),test_marketplace_server_zipandtest_marketplace_server_git(depend on the removedPluginAccessRepository). - Skipped individually as v13 behavior changes:
TestScriptRBACintest_security(scripts are now any-signed-in-user, not analyst+), profile-page tests intest_web_uithat assertedcore.analyst/Direct grants/Effective rolesmarkers from the dropped role hierarchy.
Added
/api/v2/{catalog,schema,sample,scan,scan/estimate}— discovery + scoped fetch primitives for remote-mode tables. Seedocs/superpowers/specs/2026-04-27-claude-fetch-primitives-design.md.da catalog,da schema,da describe,da fetch,da snapshot {list,refresh,drop,prune},da disk-info— CLI primitives backed by the v2 API.cli/skills/agnes-data-querying.md— Claude rails skill loaded for Agnes-flavored projects; covers discovery-first protocol,da fetchworkflow, BigQuery SQL flavor cheat-sheet, and snapshot hygiene.cli/skills/agnes-table-registration.md— admin-side companion skill: when to register single vs. bulk-discover, source-side verification before registration, idempotence rules, update/delete via REST (no CLI today), and confirmation flow.instance.yaml: api.scan.*knobs —max_limit,max_result_bytes,max_concurrent_per_user,max_daily_bytes_per_user,bq_cost_per_tb_usd,request_timeout_seconds. All optional; defaults applied if absent.instance.yaml: api.catalog_cache_ttl_seconds,api.schema_cache_ttl_seconds,api.sample_cache_ttl_seconds— TTL knobs for server-side discovery caches.instance.yaml: data_source.bigquery.legacy_wrap_views— opt-in toggle to restore the pre-v2 behavior of exposing BigQuery VIEW/MATERIALIZED_VIEW tables as DuckDB master views inanalytics.duckdb. Defaultfalse. Settruefor one release cycle when migrating existing scripts (see BREAKING note below).instance.yaml: data_source.bigquery.billing_project— optional GCP project to bill BQ jobs to / submit jobs from. Defaults todata_source.bigquery.projectfor backwards compatibility. Set when the SA hasbigquery.data.*on the data project but lacksserviceusage.services.usethere (cross-project read pattern); otherwise/api/v2/scan/estimateand BQ-mode/api/v2/scanfail with 403.- BigQuery extractor detects table type (BASE TABLE vs. VIEW / MATERIALIZED_VIEW) via
INFORMATION_SCHEMA.TABLESusing DuckDB'sbigquery_query()table function. Emits the appropriate DuckDB view:- BASE TABLE → direct
bq."dataset"."table"reference (queries hit BigQuery Storage Read API). - VIEW / MATERIALIZED_VIEW →
bigquery_query('project', 'SELECT * FROM \dataset.table`')` wrapper (queries hit BigQuery Jobs API, required for views).
- BASE TABLE → direct
- GCE metadata-server authentication for BigQuery. New
connectors/bigquery/auth.pymodule (get_metadata_token()function) fetches OAuth access tokens from the GCE metadata server on GCE instances. No service-account key file required. Both the extractor (at sync time) and the orchestrator / read-side (at ATTACH time) fetch fresh tokens on every rebuild / readonly-conn open. RaisesBQMetadataAuthErroron failure (network or malformed metadata-server response). - SQL identifier-validation helper in
src/sql_safe.py. New functionsis_safe_identifier()andvalidate_identifier()enforce safe character sets before f-stringing identifiers into SQL. BigQuery extractor and orchestrator_attach_remote_extensionsboth validatedataset,source_table, and view names before use, closing a SQL-injection surface if admin config is untrusted. /api/sync/manifestresponse now includesquery_modeandsource_typeper table, joined fromtable_registry. Clients can branch on table semantics (remote vs. local, source type) without a second API call.da sync --jsonoutput now includes askipped_remotelist with IDs ofquery_mode='remote'tables that were skipped during sync (they're not downloaded locally; only queried via/api/query).- Schema v10 introduces
view_ownershipto detect cross-connector view-name collisions in the master analytics DB (issue #81 Group C). When two connectors register the same_meta.table_name, the orchestrator now refuses to silently overwrite the prior owner's view — it logs aview_ownership collisionERROR identifying both sources and the colliding name, and the second source's view is NOT created. Previously this was last-write-wins, which depended on directory iteration order and could change deployment-to-deployment. Operators resolve a collision by renamingnameintable_registryon one side (registry-side aliasing —source_tablestays unchanged, only the view name changes). The orchestrator pre-scans every connector's_metaat the start of each rebuild and releases stale ownerships immediately (when ALL pre-scans succeed; if any fail, reconcile is skipped to avoid silently stealing a transient-IO source's name), so a renamed table frees its name in the SAME rebuild that introduces the rename — no two-step waits needed. New modulesrc/repositories/view_ownership.pyexposes the repository.
Changed
- BREAKING: BigQuery
VIEWandMATERIALIZED_VIEWtables (i.e.query_mode='remote'tables whose underlying BQ object is a view) are no longer wrapped as DuckDB master views inanalytics.duckdb.da query --remote "SELECT * FROM <bq_view>"no longer resolves the view name by default. Useda fetch <table_id> --where ... --as <snapshot_name>to materialize a local snapshot, orda query --remote "SELECT ... FROM bigquery_query('<project>', '<inner BQ SQL>')"for one-shot execution. To restore the previous behavior for a migration window, setinstance.yaml: data_source.bigquery.legacy_wrap_views: true. BQBASE TABLEentities are unaffected — their direct-ref master views remain. da syncskipsquery_mode='remote'tables. Previously they produced 404s on download attempts. Now the CLI prints a one-line stderr summary (Skipping N remote-mode tables: a, b, c (and M more)) and a separate summary line (Skipped (remote-mode): N) in the final output, distinct from existingSkipped (unchanged): Mcounts.
Fixed
/api/v2/scan500 on local-mode tables.arrow_table_to_ipc_bytes()only handledpa.Table; DuckDB's local query path returns apa.RecordBatchReader. Helper now accepts both. (Caught during dev-VM E2E.)/api/v2/schema/{table_id}500 on BigQuery tables._fetch_bq_schema()selecteddescriptionfromINFORMATION_SCHEMA.COLUMNS, which BigQuery doesn't expose there — column descriptions live inINFORMATION_SCHEMA.COLUMN_FIELD_PATHSfor nested fields. Removed the column from the SELECT; descriptions default to empty string until a real source is wired. (Caught during dev-VM E2E.)- BigQuery views failed at first query when FastAPI / CLI reopened
analytics.duckdb.SyncOrchestrator._attach_remote_extensionsfetches a fresh GCE-metadata access token and creates abigqueryDuckDB SECRET before ATTACH, but secrets are session-scoped and don't persist with the on-disk database. The mirror code insrc.db._reattach_remote_extensions(called fromget_analytics_db_readonly()) still ATTACHed BigQuery without auth, so the next query againstbq."dataset"."table"failed. Fixed by adding the same three-branch structure tosrc.db: BigQuery → fetch metadata token →CREATE OR REPLACE SECRET bq_secret_<alias> (TYPE bigquery, ACCESS_TOKEN '<token>')→ ATTACH; otherwise fall back to env-var-token / no-auth paths. Metadata-server failures log at ERROR and skip the source so other connectors still resolve. src/orchestrator.py::_attach_remote_extensionswas ineffective for BigQuery. It filtered_remote_attachlookups bytable_schema=<source_name>, but DuckDB lists an attached database withtable_catalog=<source_name>(nottable_schema), so the loop never executed and_remote_attachrows were silently ignored. Switched the filter totable_catalog, matching the corresponding query already insrc.db.- BigQuery extractor
python -m connectors.bigquery.extractorstandalone CLI now reads project ID fromdata_source.bigquery.projectmatchinginstance.yaml.example. Previously it looked for an undocumented top-levelbigquery.project_idkey and silently produced an empty string on miss, causing cryptic BigQuery API errors downstream. Now exits with code 2 + a clearlogger.errorwhen the key is missing.
Internal
- Test pattern: BigQuery extractor is exercised with a dual-path strategy (BASE TABLE + VIEW detection) via
_CapturingProxySQL-capture wrappers. DuckDB's C-implementedexecuteattribute is read-only and can't be monkey-patched directly; the proxy wraps the connection and captures outgoing SQL before forwarding to the real DuckDB conn. - Implementation plan:
docs/superpowers/plans/2026-04-27-bq-pipeline-views-and-metadata-auth.md— subagent-driven development for Tasks 1-7 of this PR.
Changed (issue #81 / #44 / #88 — security & OSS neutralization)
-
BREAKING (ops): Keboola extractor now exits with three distinct codes instead of two (issue #81 Group B / M14):
0= full success,1= full failure,2= partial failure (some tables succeeded, some failed). Previouslyexit(0)fired even when 9 of 10 tables failed, masking partial failures from the sync API and any operator alerting hooked to non-zero exit codes. The sync API (POST /api/sync/trigger) now logsPARTIAL FAILURE (exit 2)as a data-quality alert (distinct fromFAILED (exit 1)) and continues to the orchestrator rebuild step — successful tables from this run plus unchanged tables from previous runs stay queryable. Operators whose alerting treated any non-zero exit as a hard error must teach it that exit 2 is a partial-failure signal, not a deploy failure. -
BREAKING (security): The entire Script API is now admin-only (issue #44).
GET /api/scripts,POST /api/scripts/deploy,POST /api/scripts/run, andPOST /api/scripts/{id}/runall require the admin role; previously the list endpoint was open to any authenticated user and deploy/run were analyst-accessible. Two reasons: (1) the AST + string-blocklist sandbox in_execute_scriptis defense-in-depth and known to be bypassable through introspection chains (__class__.__base__.__subclasses__(),__globals__['__builtins__'],__mro__traversal — the dunder pattern list was tightened in this PR but the policy is "the role gate is the trust boundary, not the blocklist"); (2) gating only/runleft a planted-script attack open — an analyst could deploy a malicious script and wait for an admin to run it. Operators who need scripted workflows for non-admin users should run them on the user's behalf or expose the relevant data via the read-only/api/datasurface instead. Migration for cron / scheduler PATs: if a non-admin PAT is wired into a scheduler that hits/api/scripts/{id}/runor/api/scripts/run, the request now returns 403. Add the PAT user to the Admin group via/admin/accessorda admin group add-member Admin <pat-user-email>. PATs themselves do not need re-issuing — group membership is read at request time. -
BREAKING (ops): Generic ops scripts moved out of the customer-named
scripts/grpn/directory intoscripts/ops/as part of the OSS vendor-neutralization (issue #88):scripts/grpn/agnes-tls-rotate.sh→scripts/ops/agnes-tls-rotate.shscripts/grpn/agnes-auto-upgrade.sh→scripts/ops/agnes-auto-upgrade.sh
Downstream consumer infra repos that copy these scripts onto VMs (e.g. via their own
startup.sh) must update the source path. The OSS-shippedinfra/modules/customer-instance/Terraform module is unaffected — it embeds equivalent logic inline via heredoc and does not source-by-path fromscripts/. Script behaviour and env vars are unchanged. Cross-refs inREADME.md,CLAUDE.md,docs/DEPLOYMENT.md,Caddyfile, anddocker-compose.ymlwere updated. -
OSS neutralization (wave 2 — code, tests, planning docs). Customer identifiers replaced with placeholders across the codebase to ready the repo for public release (issue #88):
- Code docstrings:
connectors/openmetadata/{client,transformer,enricher}.py,src/catalog_export.py,scripts/duckdb_manager.py—prj-grp-…→my-bq-project/prj-example-1234,AIAgent.FoundryAI→AIAgent.MyAgent(in docstrings) /AIAgent.Example(in test fixtures),FoundryAIDataModel→AnalyticsDataModel. - Test fixtures in
tests/test_openmetadata_enricher.py,tests/test_duckdb_manager.py,tests/test_catalog_export.py,tests/test_openmetadata_transformer.py— same set of replacements, behaviour-preserving (157 tests still green). - Terraform module
infra/modules/customer-instance/variables.tf:customer_namedescription rewritten in English, examples switched fromkeboola, grpntoacme, example. - Workflow
.github/workflows/keboola-deploy.yml: comment "Groupon-side dev VMs" → generic "per-developer dev VMs". - Caddyfile: TLS-rotation cross-ref updated to
scripts/ops/…and Keboola-specific aside removed. - Auth docs
docs/auth-groups.mdand the OAuth probe inscripts/debug/probe_google_groups.py: GCP project namekids-ai-data-analysisreplaced with placeholderacme-internal-prod. - Planning docs under
docs/superpowers/plans/and…/specs/: the five hackathon-era documents (2026-04-21-deployment-log.md,…-multi-customer-deployment.md,…-issues-14-and-10.md,…-hackathon-dry-run.md, the spec) had34.77.94.14/34.77.102.61replaced with<dev-vm-ip>/<prod-vm-ip>,Groupon/GRPN/grpnwithAcme/another-customer, andprj-grp-…withprj-example-….
- Code docstrings:
Fixed
- BREAKING (security CRITICAL): Jira webhook handler is now
fail-closed (issue #83). Previously, if
JIRA_WEBHOOK_SECRETwas unset,_verify_signaturereturnedTrueand any unauthenticated POST to/webhooks/jiracould trigger the full ingest pipeline. The handler now returns 503 when the secret is missing (operator-misconfiguration signal, distinct from 401 wrong-signature). Operators relying on the no-secret = accept-everything mode (don't — it was never documented) must setJIRA_WEBHOOK_SECRETbefore this merges. - Security (CRITICAL): Jira issue keys arriving via webhooks are now
validated against the canonical
^[A-Z][A-Z0-9]{0,31}-[0-9]{1,12}\Zformat ([0-9]not\dto refuse non-ASCII Unicode digits,\Znot$to refuse trailing newlines that$would tolerate) before any filesystem operation (issue #83). Previously,issue_keyflowed unsanitized intoconnectors/jira/service.py(save_issue,download_attachment,_handle_deletion,process_webhook_event) andconnectors/jira/incremental_transform.py, enabling path traversal (../../etc/passwdstyle writes outside the Jira data dir). New moduleconnectors/jira/validation.pyprovidesis_valid_issue_key(regex whitelist; underscore deliberately excluded — Atlassian rejects underscores in real project keys) andsafe_join_under(Path.resolve()containment check). Both are enforced at every filesystem boundary, defense-in-depth. - Security (CRITICAL):
webhookEvent(the second attacker-controlled field in Jira webhook payloads) was used as a filename component in_log_webhook_eventwithout sanitization (issue #83 reviewer follow-up). A payload withwebhookEvent: "../../tmp/pwn"could write a JSON dump outsideWEBHOOK_LOG_DIR. The handler now strips everything that isn't[A-Za-z0-9_-](dot deliberately excluded to defeat..survival), clips length to 64 chars, and routes the final filename throughsafe_join_under. - Security (CRITICAL): hardened the connector → orchestrator trust
boundary on BOTH the rebuild path
(
src/orchestrator.py::_attach_remote_extensions) AND the read-only query path (src/db.py::_reattach_remote_extensions, called byget_analytics_db_readonly()on every request) — issue #81 Group A. Three fixes: (1) DuckDB extensions referenced by_remote_attachare matched against a hard allowlist (default:keboola, bigquery; override viaAGNES_REMOTE_ATTACH_EXTENSIONS). Install path splits built-in (LOAD only) from community (INSTALL FROM community; LOADon rebuild path; LOAD only on the read-only query path which must not touch the network). (2)token_envnames are matched against a hard allowlist (default:KBC_TOKEN,KBC_STORAGE_TOKEN,KEBOOLA_STORAGE_TOKEN,GOOGLE_APPLICATION_CREDENTIALS; override viaAGNES_REMOTE_ATTACH_TOKEN_ENVS). Names must additionally match^[A-Z][A-Z0-9_]{0,63}$. A malicious connector cannot ask the orchestrator to readJWT_SECRET_KEY/SESSION_SECRET/OPENAI_API_KEYand exfiltrate them viaATTACH ... TOKEN. (3) The URL passed toATTACHis now single-quote-escaped on both paths. Also fixed atable_schemavstable_catalogmismatch that silently no-op'd_attach_remote_extensionsfor every connector (the rebuild-path hardening would have been moot in production without this fix). New modulesrc/orchestrator_security.pycentralises the policy and exposeslog_effective_policy(), called from app startup so an operator's typo inAGNES_REMOTE_ATTACH_EXTENSIONS(which replaces the default, not extends it — a setting ofhttpfswould silently lock outkeboola, bigquery) is visible at boot rather than at the next failed attach. Seedocs/superpowers/plans/2026-04-27-issue-81-trust-boundary.md. - Security (MEDIUM): extractor-side identifier validation (issue
#81 Group D / M15). The Keboola and BigQuery extractors interpolate
table_name,bucket/dataset, andsource_tablefromtable_registrydirectly intoCREATE OR REPLACE VIEW,INSERT INTO _meta, andCOPY ... TOSQL. Anyone with write access totable_registry(admin, registry-write API) could inject SQL via these identifiers. New shared modulesrc/identifier_validation.pyexposes a strictvalidate_identifier(for our own view names —^[a-zA-Z_][a-zA-Z0-9_]{0,63}$, used fortable_nameso it matches the orchestrator's rebuild-time check and dashed names fail fast at extraction rather than being silently dropped at rebuild) and a relaxedvalidate_quoted_identifier(for upstream-typed names like Keboolain.c-foo/ BigQuerymy-dataset:[a-zA-Z0-9_][a-zA-Z0-9_.\-]*, refusing any character that could close a"..."identifier literal). The orchestrator's existing_validate_identifierwas lifted into the new module so both layers share a single source of truth; both extractors skip-and-continue on unsafe rows (logged + counted in failure stats; the rest of the registry still processes).
Removed
- Customer-specific manual-deploy helper
scripts/grpn/Makefileand its README, plus the corresponding hackathon deploy log underdocs/superpowers/plans/2026-04-22-grpn-deploy-learnings.md. These documented one operator's hand-rolled stopgap for an org-policy-blocked Terraform flow and do not belong in vendor-neutral OSS. scripts/switch-dev-vm.sh— hackathon-era helper hardcoded to a specific shared dev VM. Per-developer dev VMs are the supported pattern now; operators who need an equivalent should usegcloud compute ssh <vm> --command "sed -i …/.env && sudo /usr/local/bin/agnes-auto-upgrade.sh"with their own VM details.
Internal
- Sandbox blocklist now flags introspection-chain dunders explicitly:
__subclasses__,__globals__,__class__,__base__,__bases__,__mro__,__dict__,__code__,__builtins__.__init__and__getattribute__are intentionally not in the list — substring match would flag every legitimatedef __init__(self):. The chain breaks at the next link anyway. - New regression test
test_run_pwn_payload_blockedparametrized over the exact PoC from issue #44 plus two equivalent variants (lambda+__globals__,__mro__traversal). If the dunder list is silently weakened in a future refactor, the test fails. Newtest_*_requires_admintests parametrized over all three non-admin core roles (analyst, viewer, km_admin). tests/conftest.py::seeded_appextended withviewer_tokenandkm_admin_tokenso role-gating tests cover all four core roles.
Migrated
- Schema bumped from v9 to v10. Auto-migration applies on next start
(creates the
view_ownershiptable; data on disk is unaffected). The pre-migration snapshot machinery (added at v8→v9) covers v9→v10 too — if anything goes wrong during the migration, the snapshot at<DATA_DIR>/state/system.duckdb.pre-migratelets you roll back.
0.11.5 — 2026-04-27
Follow-up release for PR #73: addresses four rounds of Devin AI review on the role-management-complete branch. No new public-API surface; the user-visible payoff is that v8→v9-migrated installations now work end-to-end (login flows, user list, admin nav, privilege revocation), and make local-dev startup is finally quiet.
Fixed
- Privilege retention after grant revocation via the new REST API (Devin review #73).
_hydrate_legacy_rolepreviously short-circuited on a truthyuser.get("role"). The role-management endpoints (POST/DELETE /api/admin/users/{id}/role-grants, plus thechangeCoreRoleUI flow) only mutateuser_role_grants— they don't touch the legacyusers.rolecolumn. After a downgrade-via-API, the stale legacy value would keepuser["role"] = "admin"in memory;_is_admin_user_dictand the catalog/sync admin-bypass short-circuits then silently retained elevated table access even thoughrequire_internal_rolecorrectly denied the API gates. Fix: always re-resolve fromuser_role_grantsregardless of the legacy column, making the grants table the single source of truth on every authenticated request. Cost: one DB round-trip per request (same as the existing PAT-aware fallback). - Dev-bypass + OAuth callback dropped direct grants from the session cache (Devin review #73). Both call sites passed
external_groupsonly toresolve_internal_roles, never the user's id — souser_role_grantsrows were resolved on the per-request DB-fallback path insiderequire_internal_roleinstead of the cache. Functionally correct, but every admin-gated request paid a DB round-trip and the dev-bypass log line read "resolved 0 internal role(s)" for an obviously-admin user, which was confusing during debugging. Fix: passuser_idso the cache reflects the union at sign-in. GET /api/usersreturned HTTP 500 for any v8→v9-migrated installation. The migration NULL-s legacyusers.role(kept as a deprecated artifact because DuckDB FK blocks DROP COLUMN), butUserResponse.roleis a requiredstrPydantic field — every user listing failed validation./admin/usersshowed only "Failed to load users" and the new/admin/users/{id}Detail link was unreachable. Fix: route every user dict returned by the API through_hydrate_legacy_role(same shim already used byget_current_user), which derives the legacy enum value fromuser_role_grantsfor migrated users. Also fixes a quieter dual of the same bug —target["role"] == "admin"short-circuits inupdate_user/delete_userwould silently no-op on migrated admins, letting the operator demote/delete the last admin against the documented protection.- Scheduler log-noise: every cron tick produced a
POST /auth/token 401 Unauthorizedaccess-log line because the scheduler's auto-fetch fallback was always broken — it called/auth/tokenwith just an email, but the endpoint requires email + password. Fix: removed the auto-fetch path entirely. Operators setSCHEDULER_API_TOKEN(a long-lived PAT) in production; inLOCAL_DEV_MODEthe dev-bypass auto-authenticates the un-tokenized request, so jobs continue to work. - HTTP 500 on
POST /auth/tokenfor v8-migrated users (Devin review #73 round 3).TokenResponse.roleis a requiredstrPydantic field, but the v8→v9 migration NULL-s the legacyusers.rolecolumn for every existing user. The login endpoint passed the raw NULL through to Pydantic, raisingValidationError→ 500. Same root cause produced semantically wrong (but non-crashing) JWTs from Google OAuth, password, and email-magic-link flows — they wroterole: nullinto the issued token; downstream_hydrate_legacy_roleinget_current_userwould correct the per-request view, but the token payload itself stayed misleading. Fix: hydrate inline in each login flow before readinguser["role"]—app/auth/router.py(POST /auth/token),app/auth/providers/google.py(OAuth callback),app/auth/providers/password.py(5 flows: JSON login, web login, JSON setup, web reset, web setup), andapp/auth/providers/email.py(centralized in_consume_token, covers both magic-link/verifyendpoints). New regression classTestAuthLoginFlowsPostMigrationintests/test_schema_v9_migration.pypins both the no-crash and the correct-role contracts for all four legacy levels (viewer/analyst/km_admin/admin). docs/RBAC.mddocumented animplies=[…]keyword onregister_internal_role()that the function doesn't accept (Devin review #73 round 3). A module author copying the example would hitTypeError: got an unexpected keyword argument 'implies'at import time. Reality:impliesis currently seeded only for thecore.*hierarchy via_seed_core_rolesinsrc/db.py— the registry-side write path doesn't exist yet. Rewrote the Implies hierarchy and Module-author workflow sections to document what's actually supported in 0.11.4 and what a future change would need to add._seed_core_roleswas advertised as a per-connect safety net but only ran during fresh installs and the v8→v9 migration (Devin review #73 round 4). The docstring promised "called from_ensure_schemaon every connect" so an accidentalDELETE FROM internal_roles WHERE key = 'core.admin'(or a doc-tweak release that updated_CORE_ROLES_SEEDwithout bumping the schema version) would self-heal on the next process start. In reality both call sites lived insideif current < SCHEMA_VERSION:— once the DB was on v9, the seed function never ran again, leaving any deletion permanent and any in-codedisplay_name/description/implieschange requiring a manual SQL deploy. Fix: added an unconditional tail call to_seed_core_roles(conn)at the bottom of_ensure_schema, gated only bycurrent <= SCHEMA_VERSIONso the future-version-rollback contract still holds. New regression classTestSeedCoreRolesSafetyNetintests/test_schema_v9_migration.pypins all three contracts (deleted row re-seeds, mutateddisplay_namere-syncs from code,applied_atdoesn't churn on already-current DBs).make local-devstartup spammed anAuthlibDeprecationWarningfrom upstream's own_joserfc_helpers.pyevery timeapp/auth/providers/google.pytriggered thefrom authlib.integrations.starlette_client import OAuthimport chain. The warning is upstream-internal — authlib telling itself to migrate fromauthlib.josetojoserfcbefore its 2.0 cut — and isn't actionable on our side until either authlib ships the fix or we rewrite OAuth on top ofjoserfcdirectly. Filtered the specific warning class at the top ofapp/main.py(with a message-based fallback if the class moves in a future authlib release) so the warning no longer pollutes operator-facing stdout. OtherDeprecationWarnings remain visible.
Added
/profilenow self-services every user's role situation. Three new sections rendered server-side for all signed-in users (not just admins): Effective roles (the full resolver output as chip cloud — direct grants ∪ group-derived ∪ implies-expanded), Direct grants (rows inuser_role_grantswith source label:auto-seedfrom v8 backfill vs.directadmin grant), and Roles via groups (which Cloud Identity / dev group grants which role for the current user). Non-admins finally see why a particular feature is or isn't accessible without asking an admin to read the DB. Admins additionally see a deep-link to/admin/users/{id}for editing their own grants in place./admin/role-mappinggroup ID picker. A new "Known groups" panel above the create-mapping form surfaces clickable chips of group IDs known to the system: the calling admin's ownsession.google_groups(with human-readable names + a "your group" tag) merged with distinctexternal_group_ids already used in existing mappings (tagged "already mapped"). Click a chip → fills the form's external-group-id input and focuses the role select. Empty-state copy points the operator atLOCAL_DEV_GROUPS/ Google sign-in when the picker is empty, instead of leaving them to guess Cloud Identity opaque IDs from memory.
Changed
- Renamed
docs/internal-roles.md→docs/RBAC.md. Standard industry term, more discoverable for engineers grepping for "RBAC" in a new repo. Added Quickstart-by-role sections (operator / end-user / module author) and a step-by-step Module-author workflow with code examples for registering a key, gating endpoints, declaring implies hierarchies, and writing a contract test against the gate. Cross-references in code (app/api/admin.py,tests/test_role_resolver.py) updated.CLAUDE.mdnow points contributors at the new doc from the Extensibility → RBAC section. Historical CHANGELOG entries ([0.11.3]/[0.11.4]body) keep the originalinternal-roles.mdfilename — they describe what shipped at that version and aren't retro-edited.
0.11.4 — 2026-04-27
Role-management complete release. Sjednocuje legacy users.role enum (viewer/analyst/km_admin/admin) with the v8 internal-roles foundation under one model with implies hierarchy, ships admin UI + REST API + CLI for managing both group mappings and direct user grants, and wires require_internal_role for PAT-aware resolution so admin endpoints work uniformly across OAuth and headless callers.
Added
- Schema v9 — unified role model. New
user_role_grants(user_id, internal_role_id, granted_by, source)table for direct user→role assignments (complementary togroup_mappingswhich assigns via Cloud Identity group). Two new columns oninternal_roles:implies(JSON array of role keys this role transitively grants) andis_core(BOOL, distinguishes seeded core.* hierarchy from module-registered roles). Migration v8→v9 seeds fourcore.*rows (core.viewer/analyst/km_admin/admin) with the legacy hierarchy asimplies(core.admin → core.km_admin → core.analyst → core.viewer), backfills oneuser_role_grantsrow per existing user mirroring their pre-v9users.rolevalue (source='auto-seed'), and NULLs the legacy column. - PAT-aware
require_internal_role. Two-path resolution: session cache first (OAuth flow), DB-backeduser_role_grantsfallback (PAT/headless flow). Admin CLI scripts now hit gated endpoints uniformly without an OAuth round-trip. The PAT-specific 403 message from 0.11.3 is removed — PAT now legitimately resolves through direct grants. - Implies expansion at resolve time. New
expand_implies(role_keys, conn)helper inapp.auth.role_resolverdoes BFS over theimpliesgraph;resolve_internal_rolescalls it at the end so a singlecore.admingrant expands to the full four-level hierarchy automatically. - Dotted role-key namespace. Regex extended to allow
core.admin,context_engineering.admin,corporate_memory.curatorstyle keys (max 64 chars, lower-snake-case segments separated by dots). The owner_module column should match the prefix before the first dot. - REST API for role management. New router
app/api/role_management.pyunder/api/admin:GET/POST/DELETEongroup-mappings,users/{id}/role-grants, plusGET internal-rolesandGET users/{id}/effective-roles(debug). All gated byrequire_internal_role("core.admin")— works for both OAuth admins (cookie) and admin PATs. - Admin UI
/admin/role-mapping. Browse internal roles, manage Cloud Identity group → role mappings (table view + create/delete forms). User detail page extended with three sections: Core role (single-select forcore.*), Additional capabilities (multi-checkbox for module roles), Effective roles (debug view of direct + group-derived + expanded set). da adminCLI subcommands.role list,role show <key>,mapping list/create/delete,grant-role <email> <key>,revoke-role <email> <key>,effective-roles <email>. All run over PAT — use them in CI scripts to grant/revoke roles without going through the browser.
Changed
- BREAKING (semantics, not API).
users.rolecolumn NULL-ed during v8→v9 migration. Reads viaUserRepository.get_by_*still return the column but the value is always NULL after upgrade — code readinguser["role"]directly in business logic getsNone. The legacyRoleenum (Role.VIEWER/ANALYST/KM_ADMIN/ADMIN) and convenience helpers (is_admin,has_role, etc. insrc/rbac.py) continue to work — they now read fromuser_role_grantsvia the resolver. Sweepinguser.get("role") == "admin"checks were rewritten to the new helper. The column itself is preserved physically because DuckDB rejects DROP COLUMN while a FK references the table; physical drop is deferred to a future schema-rebuild migration. require_role(Role.X)andrequire_adminare now thin wrappers overrequire_internal_role(f"core.{role}"). Behavior identical for OAuth users (admin role from group_mappings); PAT users now succeed when they hold a directcore.admingrant.UserRepository.create()andupdate()mirror role changes intouser_role_grantsautomatically (_grant_core_rolehelper); existing setup code keeps working without changes.UserRepository.delete()pre-deletesuser_role_grantsrows (DuckDB FK doesn't auto-cascade).UserRepository.count_admins()readsuser_role_grants ⨝ internal_roles WHERE key='core.admin'— the legacyusers.role = 'admin'count would always return 0 after backfill.app/api/admin.pymodule-level docstring documents the v9 pattern for module authors who want to add their own capability gates.docs/internal-roles.mdrewritten to remove the v8 "no UI yet" caveat, document the implies hierarchy, the dual session/DB resolution pathway, and the dotted-namespace key convention.
Removed
require_internal_role's session-only enforcement (the v8 "This endpoint needs an interactive (OAuth) session — Bearer/PAT tokens do not carry session-resolved roles" error message). PAT clients with a matchinguser_role_grantsrow now pass the gate uniformly.
Internal
- New
UserRoleGrantsRepositoryinsrc/repositories/user_role_grants.pymirrors the style ofGroupMappingsRepository(list/get/create/delete + per-user / per-role indices). - INFO-level audit log on grant + mapping mutations (action strings:
role_mapping.created/deleted,role_grant.created/deleted, resourcemapping:<id>/grant:<id>). - "Last admin protection" on
DELETE /api/admin/users/{id}/role-grants/{grant_id}: refuses to delete the finalcore.admingrant in the system (mirrors existingcount_adminsprotection on user deletion / deactivation).
0.11.3 — 2026-04-26
Authorization-foundation release — adds the internal-roles layer between Cloud Identity groups and per-module capability checks. Schema v8 migration; no admin UI yet (follow-up).
Added
- Internal roles + group mapping (foundation). Schema v8 adds two tables:
internal_roles(app-defined capabilities likecontext_admin,agent_operator, registered by Agnes modules at import time) andgroup_mappings(many-to-many bindings of Cloud Identity group IDs to internal role keys, managed by admins). Newapp.auth.role_resolvermodule exposesregister_internal_role(...)for module authors,sync_registered_roles_to_db(...)(run once at startup, idempotent),resolve_internal_roles(external_groups, conn)(called at sign-in, writes resolved keys intosession["internal_roles"]), and arequire_internal_role("…")FastAPI dependency factory for permission checks. Resolution runs at sign-in (Google OAuth callback + dev-bypass — populates on first request and whenever external groups change, mirroring the OAuth callback's always-write semantics). No DB hit per request. Refresh requires re-login, same semantics assession.google_groups. No admin UI yet — mapping rows must be created via the repository directly until the management UI ships in a follow-up. PAT/headless clients carry no session and therefore cannot passrequire_internal_rolegates by design —require_internal_roledistinguishes "signed-in but missing role" from "no session at all" and surfaces a PAT-specific 403 detail in the second case so an API consumer hitting the wall sees what to fix. Seedocs/internal-roles.md→ PAT and headless requests.
Changed
docs/internal-roles.mddocumentsAdmin → Users → deactivate then reactivateas the supported "force re-resolve now" lever for users you can't get to log out (long-lived sessions, automated clients) — invalidates the existing session and forces a fresh sign-in on the next request.
Internal
- INFO-level audit log on every successful resolve (OAuth callback + dev-bypass) so a "wrong role" complaint is debuggable from the log alone — admin can correlate "user X claims they lost access" with the resolver output without replaying the request.
- Startup warning when
SESSION_SECRETis shorter than 32 chars, matching the existingJWT_SECRET_KEYgate. Both HMAC surfaces sign trust-laden state (session.internal_roles,session.google_groups, JWTs) — keeping the two gates consistent so a weak secret gets surfaced at boot, not after a quiet downgrade. _clear_registry_for_tests()now refuses to run unlessTESTING=1so a stray import path in production can't drop the registered capabilities.
0.11.2 — 2026-04-26
Dev-experience patch release — make LOCAL_DEV_MODE realistic enough to actually exercise group-aware code paths on localhost, and consolidate scattered dev-onboarding instructions into a single docs/local-development.md.
Added
LOCAL_DEV_GROUPSenv var mockssession.google_groupsfor the auto-logged-in dev user whenLOCAL_DEV_MODE=1. JSON array matching the production shape ([{"id":"…","name":"…"}]) so group-aware UI and access-control code paths can be exercised onlocalhostwithout a Google OAuth round-trip. Honored only underLOCAL_DEV_MODE=1. The startup banner reports the parsed group IDs (or warns loudly when the value is set but malformed), so a typo gets surfaced at boot rather than silently on the first authenticated request. Session injection mirrors the production OAuth callback's "always-write" semantics — including clearing stale groups when the operator unsetsLOCAL_DEV_GROUPSmid-session. Seedocs/auth-groups.md→ Local-dev mock.make local-devnow seeds two default mocked groups (Local Dev Engineers+Local Dev Adminsonexample.com) viascripts/run-local-dev.sh, so first-boot/profileis non-empty out of the box. Override withLOCAL_DEV_GROUPS='[…]' make local-dev; disable withLOCAL_DEV_GROUPS= make local-dev.docs/local-development.md— single onboarding doc for working on Agnes locally: TL;DR, whatLOCAL_DEV_MODEactually bypasses, group mocking, what isn't mocked, and the security-rails reminder that dev mode must never reach a production deploy.
Internal
- Fix nightly
docker-e2eCI failures: refresh two stale assertions that had drifted from the live API.tests/test_docker_full.py::test_app_returns_html_on_rootnow expects the auth-aware302 → /login(root has redirected since the auth middleware landed);tests/test_e2e_docker.py::TestDockerHealth::test_health_has_duckdbnow readsservices["duckdb_state"](current health-payload shape, already validated bytests/test_api.py). No application behavior change — these only ran in the scheduled nightly job, so the drift went unnoticed for several PRs.
0.11.1 — 2026-04-26
Patch release — hotfix the missed Caddy env passthrough that should have shipped with 0.11.0, plus codify changelog discipline so this kind of drift gets caught at PR review time next time.
Fixed
docker-compose.ymlcaddy service now passesCADDY_TLSthrough to the container (- CADDY_TLSbare-form passthrough). Without it theCaddyfile{$CADDY_TLS:default}substitution always falls back to cert-file mode regardless of what the operator wrote into.env, and Caddy crash-loops on Let's Encrypt / internal-CA deployments. Should have shipped with #52; first attempt was #55, accidentally closed before merging.
Internal
CLAUDE.md— non-negotiable changelog discipline: every PR touching user-visible behavior must updateCHANGELOG.mdunder## [Unreleased]in the same PR.
0.11.0 — 2026-04-26
First tagged semver release. The version = "2.x" strings that appeared in earlier pyproject.toml snapshots were arbitrary placeholders from the initial scaffold and never reflected actual API maturity — resetting to pre-1.0 to signal that things may still shift.
Added — Auth
- Google Workspace groups on
/profile. OAuth callback fetches the signed-in user's group memberships via Cloud Identity (searchTransitiveGroupswith thesecuritylabel — seedocs/auth-groups.mdfor the GCP setup checklist and thesecurity-vs-discussion_forumgotcha). Profile link added to the user dropdown. - Password reset + invite flows for web and admin (
/auth/password/reset,/admin/users/invite). - Personal access tokens (PAT) with separate
:typ=patJWT claim, per-token revoke, last-used IP tracking, "My tokens" + admin "All tokens" UI. - Email magic-link provider (itsdangerous-signed token).
- Optional
SEED_ADMIN_PASSWORDto pre-hash the seed admin (dev convenience).
Added — Deploy
keboola-deploy.ymlworkflow. Tag-triggered alternative torelease.ymlfor shared dev VMs that want explicit "deploy when I tag" semantics. Publishes immutable:keboola-deploy-<tag>+ floating:keboola-deploy-latestalias.- Caddy + Let's Encrypt + corporate-CA TLS.
Caddyfileparametrized via$CADDY_TLSenv var so a single file serves three regimes: cert-file (corp PKI), Let's Encrypt auto-issue, Caddy-internal-CA. URL-driven cert rotation with self-signed fallback (scripts/grpn/agnes-tls-rotate.sh).docker-compose.tls.ymloverlay closes host:8000when Caddy fronts. dev_instancesschema incustomer-instanceTerraform module gains optionaltls_mode+domain(mirrorsprod_instance).infra-v1.6.0tag.- Optional Google OAuth credentials from Secret Manager. Module reads
google-oauth-client-{id,secret}at boot if present; graceful fallback so non-Google deployments aren't affected. LOCAL_DEV_MODE+make local-dev-up/local-dev-downfor one-keystroke local stack with magic-link auth pre-wired.- Per-developer
dev-<prefix>-latestGHCR alias for branches matching<prefix>/<branch>— push-to-deploy on personal dev VMs. /setupweb wizard for first-time instance setup, plus headlessPOST /api/admin/configureandPOST /api/admin/discover-and-register.- Smoke-test job in CI (Docker-in-CI after every release) +
scripts/smoke-test.shfor post-deploy verification.
Added — CLI
- Wheel distribution + auto-update check on startup.
--versionflag,--dry-run+X/Nprogress onda sync, durable sync (atomic writes + manifest hash + retry on transient errors).- gzip on JSON/HTML responses (server-side).
Added — Data
- Remote query engine. Two-phase BigQuery + DuckDB engine for tables too large to sync locally (
--register-bqflag). - Business metrics. Standardized
metric_definitionstable in DuckDB with starter pack importer (da metrics import). /api/healthreturnsversion,channel,commit_sha,image_tag,schema_version.- Custom connector mount support (
connectors/custom/). - OpenAPI snapshot test for breaking-change detection.
Added — Docs / tooling
docs/auth-groups.md,docs/DEPLOYMENT.md,docs/HACKATHON.md,docs/ONBOARDING.mdrunbooks.scripts/debug/probe_google_groups.py— stdlib-only probe for diagnosing Cloud Identity API issues without a deploy cycle.- Schema migration safety tests (idempotency, data preservation, snapshot).
- Pre-migration snapshot of
system.duckdbbefore schema upgrades. - Auto-generated JWT and session secrets with file persistence (
/data/state/.jwt_secret). - Startup banner logging version, channel, and schema version.
Changed
- BREAKING (deployment) — Caddy compose profile renamed
production→tls. Existingdocker compose --profile production up -dinvocations need to switch. - BREAKING (deployment) — Default
Caddyfilemode is now cert-file (tls /certs/fullchain.pem /certs/privkey.pem); for the previous Let's Encrypt auto-issue behaviour setCADDY_TLS=tls <ops-email>in.env. Seedocs/auth-groups.mdandCaddyfileinline docs. - Schema migration v5→v6→v7: adds
users.active,personal_access_tokenstable,personal_access_tokens.last_used_ip. Auto-applied at boot. - Image-level
AGNES_VERSIONnow sourced frompyproject.tomlat build time (no more drift betweenda --versionand the package metadata). - Vendor-agnostic OSS rule codified in
CLAUDE.md— customer-specific names, hostnames, project IDs belong in consumer infra repos, not in this OSS distribution.
Fixed — Security
- Open-redirect guard for backslash in
safe_next_path. SessionMiddleware max_age=3600 + https_only(was browser-session forever, plain-HTTP-OK).- Timezone-aware datetimes in Keboola metadata cache.
- Atomic magic-link token consumption (closes double-use race under concurrent clicks).
- Bootstrap backdoor closed when passwordless seed admin exists.
- urllib3 1.26→2.6.3 (resolves 4 Dependabot security alerts).
- argon2-cffi adopted for password hashing.
- See docs/security-audit-2026-04.md for the full audit (renamed from
docs/padak-security.mdin #94).
Fixed — Other
uvicorn --proxy-headers --forwarded-allow-ips='*'so OAuth callbacks resolve to https when behind a TLS terminator.scripts/grpn/agnes-tls-rotate.shhardened:--max-redirs 0+--proto '=https'on cert fetch, post-fetch PEM validation (rejects HTML error pages from corp portals),ulimit -c 0to suppress coredumps that could leak the unencrypted privkey, POSIX-safe${arr[@]+"${arr[@]}"}array expansion.scripts/tls-fetch.sh— generic URL fetcher (sm://,gs://,https://,file://) with redirect refusal + PEM validation.kbcstoragemoved to optional dep — unblocks urllib3 security updates; primary Keboola path now uses the DuckDB Keboola extension.- Dependencies consolidated into
pyproject.toml(no morerequirements.txt).
Internal
- Test suite expanded to 1357+ tests (4 layers — unit, integration, web smoke, journey).